简体   繁体   中英

Undefined namespace prefix on previously working SPARQL query

I am interested in the geographic coordinates of banks, central banks, financial institutions, universities and colleges. This is my query:

SELECT ?label ?lat ?long
WHERE {
  {?x dct:subject category:International_finance_institutions } UNION
  {?x dct:subject category:Federal_Reserve_Banks } UNION 
  {?x dct:subject category:Central_banks } UNION 
  {?x a <http://schema.org/CollegeOrUniversity> }.
     ?x geo:lat ?lat .
     ?x geo:long ?long .
     ?x rdfs:label ?label.
        FILTER (LANGMATCHES(LANG(?label), 'en')) 
}

Exactly this code worked (last download: June 21st, 2015). This morning however I keep getting this error: Virtuoso 37000 Error SP030: SPARQL compiler, line 5: Undefined namespace prefix at 'category' before '}' . I was checking the list of predefined namespaces , but all seems correct. What's wrong with category ? BTW: I also tried other codes offered on this side, and some are also not working. Did the virtuoso guys change something?

They have changed the namespaces . so you need to change category: to dbc: .

SELECT ?label ?lat ?long
WHERE {
  {?x dct:subject dbc:International_finance_institutions } UNION
  {?x dct:subject dbc:Federal_Reserve_Banks } UNION 
  {?x dct:subject dbc:Central_banks } UNION 
  {?x a <http://schema.org/CollegeOrUniversity> }.
     ?x geo:lat ?lat .
     ?x geo:long ?long .
     ?x rdfs:label ?label.
    FILTER (LANGMATCHES(LANG(?label), 'en')) 
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM