ulan event example

29 views
Skip to first unread message

Vladimir Alexiev

unread,
Apr 20, 2019, 7:10:22 AM4/20/19
to Getty Vocabularies as Linked Open Data
Wikidata user Marsupium writes about http://vocab.getty.edu/doc/queries/#Life_Events:
"Behind the schema:location a /^foaf:focus is missing I think".

I think he's right and so the query should be:

select * {
  bind
(ulan:500015257 as ?x).
 
?x foaf:focus [bio:event ?event].
 
?event dct:type [gvp:prefLabelGVP [xl:literalForm ?type]].
  bind
(exists {?x foaf:focus [gvp:eventPreferred ?event]} as ?pref)
  optional
{?event rdfs:comment ?comment}
  optional
{?event gvp:displayOrder ?order}
  optional
{?event gvp:estStart ?start}
  optional
{?event gvp:estEnd ?end}
  optional
{?event schema:location/^foaf:focus [gvp:prefLabelGVP [xl:literalForm ?place]]}
} order by ?order desc(?pref)

However, there seems to be some problem with the site: both the original and this modified query take a long time and return no results.
Gregg, could you take a look?

Getty Vocabularies LOD

unread,
Apr 22, 2019, 5:27:43 PM4/22/19
to Getty Vocabularies as Linked Open Data
Yes, the query work correctly, but it hits the 2 minute query time limit. I'm not sure how to speed it up besides simplifying the query.

Gregg

Johannes Kleybolte

unread,
Apr 24, 2019, 2:16:59 PM4/24/19
to Getty Vocabularies as Linked Open Data
Hi, the problem for speed is the exists function which is pretty slow. In addition, ?pref isn't bound for events that are values of gvp:eventNonPreferred which makes only thoses of gvp:eventPreferred show up. Binding the sub-properties gvp:eventPreferred and gvp:eventNonPreferred directly to a variable and using that fixes both problems and also makes inferring (or checking the "Include inferred" check box) unnecessary:

select * {
  bind
(ulan:500015257 as ?x).
  values ?prop { gvp:eventPreferred gvp:eventNonPreferred }
 
?x foaf:focus [?prop ?event].
  ?event dct:type [gvp:prefLabelGVP [xl:literalForm ?type]].

  optional
{?event rdfs:comment ?comment}
  optional
{?event gvp:displayOrder ?order}
  optional
{?event gvp:estStart ?start}
  optional
{?event gvp:estEnd ?end}
  optional
{?event schema:location/^foaf:focus [gvp:prefLabelGVP [xl:literalForm ?place]]}
} order by ?order desc(?prop)

Johannes

Vladimir Alexiev

unread,
Apr 28, 2019, 3:19:03 AM4/28/19
to Getty Vocabularies as Linked Open Data
Inferences are materialized in GraphDB (OWLIM) so querying by the super prop is faster than querying by the sub props. But the Exists is indeed too slow, which is a shame.

We look at the opportunity to upgrade GraphDB at the Getty, which is 3.5 years old.

Reply all
Reply to author
Forward
0 new messages