How to get all Subjects of a Given Parent in a different language than EN?

91 views
Skip to first unread message

Ykje

unread,
Dec 21, 2015, 4:01:41 PM12/21/15
to Getty Vocabularies as Linked Open Data
Hello,

Today I've discovered the AAT Sparql Endpoint, leaving me both excited and frustrated after six hours of "trying" to write queries.
For a terminology collaboration on fashion I'm running I would love to get all the "300209261" children subject terms in Dutch, and preferably with their Alt Label, scope note, English term and Identifier.

But I'm not even able to get the terms in Dutch, for I'm new to both Sparql and JSON.

Does anyone have an idea?

Many thanks!

Warm wishes,

Ykje Wildenborg


Vladimir Alexiev

unread,
Dec 22, 2015, 3:31:14 AM12/22/15
to Getty Vocabularies as Linked Open Data
Here it is. I'd say about 90-95% have NL labels.
  • Remove the limit to get them all (about 1300). 
  • Add "a skos:Concept" if you don't want guide terms like <harnassen naar functie>
  • Use gvp:term rather than xl:literalForm if you don't want qualifiers in parentheses

select ?x ?id ?gvpLabel ?prefNl (group_concat(?alt; separator="; ") as ?altNl) ?noteNl {
 
?x gvp:broaderExtended aat:300209261;
    dc
:identifier ?id;
    gvp
:prefLabelGVP [xl:literalForm ?gvpLabel].
  optional
{?x xl:prefLabel [dct:language gvp_lang:nl; xl:literalForm ?prefNl]}
  optional
{?x xl:altLabel [dct:language gvp_lang:nl; xl:literalForm ?alt]}
  optional
{?x skos:scopeNote [dct:language gvp_lang:nl; rdf:value ?noteNl]}
} group by ?x ?id ?gvpLabel ?prefNl ?noteNl
limit
100

Ykje

unread,
Dec 22, 2015, 5:52:59 AM12/22/15
to Getty Vocabularies as Linked Open Data
Dear Vladimir,

This my best Christmas present this year!
For weeks I've been in doubt about how to get these terms.

Now I can proceed with my project.

Many, many thanks.

Best wishes, happy days,

Ykje

Op dinsdag 22 december 2015 09:31:14 UTC+1 schreef Vladimir Alexiev:

Ykje

unread,
Feb 22, 2021, 4:58:59 AM2/22/21
to Getty Vocabularies as Linked Open Data
Dear Vladimir and Gregg,

A few messages close to eachother, since I am in the middle of a very exciting job I need this info for... 
I am writing in name of the MoMu Fashion Museum in Antwerp, Belgium.
We are matching object names to the AAT.

This morning I tried to get the data myself for an hour without succes.
I did find more info in order to tell you what I need more clearly, here it is:

I need the values of the property "parentString" added to the query above in your previous message. 
If possible in Dutch. If this is not possible, BroaderExtended.

I hope you or someone knows how to retrieve this info :)

Thanks in advance & all the best,

Ykje Wildenborg



Op dinsdag 22 december 2015 om 09:31:14 UTC+1 schreef vlad...@sirma.bg:

Vladimir Alexiev

unread,
Apr 20, 2021, 5:03:55 AM4/20/21
to Ykje, Getty Vocabularies as Linked Open Data
Hi Ykje! You can get parentString very easily (see below) but it's made only of English labels (prefLabelGVP).
If you want to get similar info in Dutch, it's highly non-trivial since you need to order somehow the broaderExtended ancestors.
Because the query already uses group_concat, it's best to make a second query to get those ancestors and their immediate parents, and to reconstruct the tree using this info.

select ?x ?parents ?id ?gvpLabel ?prefNl (group_concat(?alt; separator="; ") as ?altNl) ?noteNl {
  ?x gvp:broaderExtended aat:300209261;
    gvp:parentString ?parents;
    dc
:identifier ?id;

    gvp
:prefLabelGVP [xl:literalForm ?gvpLabel].
  optional 
{?x xl:prefLabel [dct:language gvp_lang:nl; xl:literalForm ?prefNl]}
  optional 
{?x xl:altLabel [dct:language gvp_lang:nl; xl:literalForm ?alt]}
  optional 
{?x skos:scopeNote [dct:language gvp_lang:nl; rdf:value ?noteNl]}
} group by ?x ?parents ?id ?gvpLabel ?prefNl ?noteNl
limit 
100

--
You received this message because you are subscribed to the Google Groups "Getty Vocabularies as Linked Open Data" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gettyvocablo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gettyvocablod/5e6c5884-8fcf-4f80-b0c7-31fe2e6fc02fn%40googlegroups.com.

Ykje

unread,
Apr 26, 2021, 4:51:06 AM4/26/21
to Getty Vocabularies as Linked Open Data
Dear Vladimir,

Thanks for your answer!

All the best,

Ykje

Op dinsdag 20 april 2021 om 11:03:55 UTC+2 schreef Vladimir Alexiev:
Reply all
Reply to author
Forward
0 new messages