执行查询时出现错误,在 '_New_South_Wales' 之前的 ',' 处出现语法错误。
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX grs: <http://www.georss.org/georss/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
SELECT ?label ?country ?isPartOf ?_type ?capital ?lcity ?geopoint
WHERE {
{ dbr:Eraring,_New_South_Wales rdfs:label ?label . FILTER(LANGMATCHES(LANG(?label), "en"))}
UNION{OPTIONAL{dbr:Eraring,_New_South_Wales dbo:country ?country} }
UNION{OPTIONAL{dbr:Eraring,_New_South_Wales dbo:isPartOf ?isPartOf}}
UNION{OPTIONAL{dbr:Eraring,_New_South_Wales <http://purl.org/linguistics/gold/hypernym> ?_type}}
UNION{OPTIONAL{dbr:Eraring,_New_South_Wales dbo:capital ?capital}}
UNION{OPTIONAL{dbr:Eraring,_New_South_Wales dbo:largestCity ?lcity}}
UNION{OPTIONAL{dbr:Eraring,_New_South_Wales grs:point ?geopoint}}
}
完整的错误报告如下。
Virtuoso 37000 错误 SP030:SPARQL 编译器,第 21 行:在 '_New_South_Wales' SPARQL 查询之前的 ',' 处出现语法错误:#output-format:application/sparql-results+json 定义输入:default-graph-uri PREFIX owl:PREFIX xsd: PREFIX rdfs: PREFIX rdf: PREFIX foaf: PREFIX dc: PREFIX : PREFIX dbpedia2: PREFIX dbpedia: PREFIX skos: PREFIX dbo: PREFIX dbp: PREFIX dbr: PREFIX grs: PREFIX geo: SELECT ?label ?country ?isPartOf ?_type ?capital ? lcity ?geopoint WHERE { { dbr:Eraring,_New_South_Wales rdfs:label ?label . FILTER(LANGMATCHES(LANG(?label), "en"))} UNION{OPTIONAL{dbr:Eraring,_New_South_Wales dbo:country ?country} } UNION{OPTIONAL{dbr:Eraring,_New_South_Wales dbo:isPartOf ?isPartOf}} UNION{可选{dbr:Eraring,_New_South_Wales ?_type}} UNION{可选{dbr:Eraring,_New_South_Wales dbo:capital ?capital}} UNION{可选{dbr:Eraring,
这是您可以自己测试此查询的链接。 snorql