Getting more data out of ULAN

Skip to first unread message

Vladimir Alexiev

Jan 7, 2016, 3:46:06 AM1/7/16
to Getty Vocabularies as Linked Open Data,,
People working for the Gilcrease Museum (Tulsa, Oklahoma) are asking

We are currently developing a website application for displaying and searching the collections of the Gilcrease Museum. One portion of this application is to integrate the artist and creator records with Getty ULAN linked open data. We plan to query supplementary data from ULAN about the artist and creator
The fields we are attempting to query and display on the website are: Note, Names (all), Birth Date, Death Date, Nationalities, Roles, Gender, Death Place, Events, and Related People or Corporate Bodies.
We have reviewed the example queries found on the Getty website and been able to build a sample query that gets us close to what we are trying to do:

select ?x ?Name ?Bio ?Birthplace ?labGVP ?Deathplace ?Gender ?Start ?End ?Nationality ?Term ?Parents ?ScopeNote {
?x a skos:Concept; dc:identifier "500015257";
:prefLabelGVP [xl:literalForm ?Term].
?x gvp:prefLabelGVP/xl:literalForm ?Name;
:focus/gvp:biographyPreferred ?biography.
?biography gvp:estStart ?Start;
:estEnd ?End;
:gender [gvp:prefLabelGVP [xl:literalForm ?Gender]]
{?biography schema:birthPlace ?Birthplace}
{?biography schema:deathPlace ?Deathplace}
{?x foaf:focus [gvp:nationalityPreferred [gvp:prefLabelGVP [xl:literalForm ?Nationality]]];}
{?x foaf:focus/gvp:biographyPreferred/schema:description ?Bio}
{?x gvp:parentStringAbbrev ?Parents}
{?x skos:scopeNote [dct:language gvp_lang:en; rdf:value ?ScopeNote]}

Comments on the above query:
  1. Use indentation after ";" to show the nesting of sub-patterns.
  2. Selecting by dc:identifier "500015257" is a little inefficient. Better use bind(ulan:500015257 as ?x)
  3. Once you pick ?biography there's no need to navigate to it again using ?x foaf:focus/gvp:biographyPreferred/...
  4. These two forms fetch exactly the same (but the first is more robust because of a SPARQL parser bug (SES-2024), as documented in
    ?x gvp:prefLabelGVP [xl:literalForm ?Term].
    ?x gvp:prefLabelGVP/xl:literalForm ?Name;
  5. If you need to fetch all names, you need to use xl:prefLabel|xl:altLabel [xl:literalForm ?anyName], and then group_concat()

Now to answer some other questions:

1. How can we get all the relations a Subject has ex:

This is explained in You can adapt it for your case eg like this:
select * {
(ulan:500015257 as ?x)
?x ?rel ?related.
?rel sesame:directSubPropertyOf skos:related; dc:title ?relName.
?related gvp:prefLabelGVP/xl:literalForm ?relatedName.
?related foaf:focus/gvp:biographyPreferred/schema:description ?relatedBio.
:subject ?x;
:predicate ?rel;
:object ?related;
:comment ?comment]}}
If you don't care about possible "display date" (?comment), just drop the optional{...}

1a. and are there posibilities of other relations?

Yes. All ULAN relations are listed in You can also get them as PDF or XLSX from, which is easier to read and understand

2. How can we query for "Has Affiliation" with corporate bodies, related organizations

These are also associative relations. You could filter by source or target type, eg here's how to find relations from Person to Group (corporate body):
select ?x ?xName ?rel ?relName ?y ?yName {
?x ?rel ?y.
?x a gvp:PersonConcept.
?y a gvp:GroupConcept.
?rel sesame:directSubPropertyOf skos:related; dc:title ?relName.
?x gvp:prefLabelGVP [xl:literalForm ?xName].
?y gvp:prefLabelGVP [xl:literalForm ?yName].
} limit 10
(Note: it may time out on, I posted an issue, if so then try it on

But I think in your case it's better to get all relations, then sort them by target type.

3. How can we query for related events?

Here's a sample query (I'll add it to the documentation):
select * {
(ulan:500015257 as ?x).
?x foaf:focus [bio:event ?event].
?event dct:type [gvp:prefLabelGVP [xl:literalForm ?type]].
(exists {?x foaf:focus [gvp:eventPreferred ?event]} as ?pref)
{?event rdfs:comment ?comment}
{?event gvp:displayOrder ?order}
{?event gvp:estStart ?start}
{?event gvp:estEnd ?end}
{?event schema:location [gvp:prefLabelGVP [xl:literalForm ?place]]}
} order by ?order desc(?pref)

Please note that events having the same type (eg "active") often express different opinions about the event details (dates), not several actual instances. In such case you should display only the Preferred event. But ULAN offers no information which event types imply single-instance events.

Lehel Matyus

Jan 26, 2016, 7:48:02 PM1/26/16
to Getty Vocabularies as Linked Open Data
Hi Vladimir,

thank you for your response.
If I may ask your help with some further questions:

1. I am wondering how to return the literal form of a TGN
in the very last query (3), the line:

optional {?event schema:location [gvp:prefLabelGVP [xl:literalForm ?place]]}

returns "-" instead of "Philadelphia"

even though, when you run the query,
the event
has schema:location (Philadelphia)

2. What would be the best way to filter the relations query provided in your response (2) to a ULAN (ulan:500015257) so the query is more efficient.

Thank you,

Vladimir Alexiev

Feb 1, 2016, 2:48:56 AM2/1/16
to Lehel Matyus, Getty Vocabularies as Linked Open Data


optional {?event schema:location [gvp:prefLabelGVP [xl:literalForm ?place]]}

returns "-" instead of "Philadelphia"


Sorry, the label is attached to not

To get to it, try to use foaf:focus in is inverse direction:

optional {?event schema:location [^foaf:focus/gvp:prefLabelGVP [xl:literalForm ?place]]}

2. What would be the best way to filter the relations query provided in your response (2) to a ULAN (ulan:500015257) so the query is more efficient.

Given that ?x is bound, I don’t think the query can be optimized much. Is it slow?

Reply all
Reply to author
0 new messages