Linked data and endpoint
Why does the end point matters so much to the end results of the query.
For this query:
SELECT ?episode,?chalkboard_gag WHERE {
?episode skos:subject
http://dbpedia.org/resource/Category:The_Simpsons_episodes%2C_season_开发者_如何学C12.
?episode dbpedia2:blackboard ?chalkboard_gag
}
The endpoint "OpenLink Virtuoso SPARQL protocol" returns 1 result.
"http://dbpedia.org/snorql" ("http://dbpedia.org/sparql", i am using jena also) produces 4 results, which is the correct, since only 4 of the episodes have blackboard information created.
Why the diferences?For the first endpoint, do you mean http://lod.openlinksw.com/sparql? I'm not seeing different results between that and http://dbpedia.org/sparql. For example, this query, expanding on yours, seems to return the same stuff from both endpoints (if indeed they're actually different servers; I can't tell).
prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix category: <http://dbpedia.org/resource/Category:>
prefix dbpedia2: <http://dbpedia.org/property/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?airdate ?chalkboard_gag ?episode
WHERE {
?episode skos:subject ?cat .
?cat skos:broader category:The_Simpsons_episodes .
?episode dbpedia2:airdate ?airdate .
?episode dbpedia2:blackboard ?chalkboard_gag .
FILTER langMatches( lang(?chalkboard_gag), 'en') .
FILTER xsd:dateTime(?airdate)
}
ORDER BY ?airdate
The one thing I know of that would produce different results would be query timeouts. Virtuoso can cut off queries after they've been running for a certain amount of time, and your different endpoints might have been under different loads when you tried them, and/or configured with different timeouts.
I note, parenthetically, that if this data were in Needle, and queried in Thread instead of SPARQL, this query could be as simple as:
Episode:(.Subject:<~The Simpsons)^Airdate|Airdate,Blackboard
Except in Needle you'd probably actually model TV shows like TV shows, rather than relying on levels of generic SKOS subject/broader abstractions, and thus might actually have:
Show:=The Simpsons.Season.Episode|Airdate,Blackboard
精彩评论