Hi Stardog team!
I'm trying out the linked data features of Stardog and need some guidance. I'm sure that I'm overlooking something, and ask that you point me in the right direction.
For a demo, I'm pulling some resources' data into Stardog 4.0.5 from DBpedia, which I'll use to link to the rest of the data for these resources. My database was created using the reasoning.sameas=ON configuration option. I have verified on the Database page that the Reasoning type is SL and SameAs reasoning is ON.
The following populates Stardog with the triples that I expect:
PREFIX dbo: <
http://dbpedia.org/ontology/>
PREFIX dbr: <
http://dbpedia.org/resource/>
PREFIX dbp: <
http://dbpedia.org/property/>
INSERT {
?celebrityURI rdf:type :Celebrity ;
rdfs:label ?personName ;
owl:sameAs ?personURI.
}
WHERE {
BIND (URI(CONCAT('
http://mydomain.com/data/Celebrity/CL', substr(str(rand()), 3, 16))) AS ?celebrityURI)
SERVICE <
http://www.dbpedia.org/sparql/> {
SELECT DISTINCT ?personURI ?personName
WHERE {
?personURI rdf:type dbo:Person ;
rdfs:label ?personName ;
dbo:birthYear ?birthYear ;
dbo:nationality dbr:United_States .
FILTER (langMatches(lang(?personName), "EN"))
FILTER (?birthYear >= "1900-01-01"^^xsd:date)
}
}
}
A new URI (based on a random value) is created as each person is added to the local database. Every person in the local database has a owl:sameAs triple that references their URI in DBpedia. With the SPARQL Query Panel Reasoning switched to ON. I run the following query to access the local data AND their data in DBpedia:
PREFIX dbo: <
http://dbpedia.org/ontology/>
PREFIX dbr: <
http://dbpedia.org/resource/>
PREFIX dbp: <
http://dbpedia.org/property/>
SELECT DISTINCT ?personName ?birthPlaceName ?population
WHERE {
?celebrityURI rdf:type :Celebrity ;
rdfs:label ?personName .
OPTIONAL {
?celebrityURI dbo:birthPlace ?BirthPlaceURI .
?BirthPlaceURI rdfs:label ?birthPlaceName .
?BirthPlaceURI dbp:populationTotal ?population .
}
} ORDER BY ?personName
I'm able to get the local data, but not the linked DBpedia data. I've also tried the following to force the lookup by the DBpedia URI:
WHERE {
?celebrityURI rdf:type :Celebrity ;
rdfs:label ?personName ;
owl:sameAs ?personURI .
OPTIONAL {
?personURI dbo:birthPlace ?BirthPlaceURI .
?BirthPlaceURI rdfs:label ?birthPlaceName .
but do not get the linked data in this manner either. Can you suggest a direction for me to pursue next to resolve this?
Thanks!
Tom