Closed Nasreddine closed 5 years ago
Hi Nesreddine,
what query did you want to execute? Please provide some more information.
Sincerely,
Mark
Hi Knurg, I want to extract information about vocabularies using SPARQL query with FROM clause (where I specify the external URL of the vocabulary ) . This is an example a query which extract FOAF classes information :
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
select *
from http://xmlns.com/foaf/0.1/
where {
{?class rdf:type owl:Class}
union
{?class rdf:type rdfs:Class}.
OPTIONAL {?class rdfs:label ?label}.
OPTIONAL {?class rdfs:subClassOf ?superclass}.
OPTIONAL {?class rdfs:comment ?comment}.
}
limit 1000
Thanks.
The query looks good. However URLs (also the graph URL) have to be written in <> . Try this:
prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#\ prefix rdfs: http://www.w3.org/2000/01/rdf-schema#\ prefix owl: http://www.w3.org/2002/07/owl#\ select * from http://xmlns.com/foaf/0.1/\ where { {?class rdf:type owl:Class} union {?class rdf:type rdfs:Class}. OPTIONAL {?class rdfs:label ?label}. OPTIONAL {?class rdfs:subClassOf ?superclass}. OPTIONAL {?class rdfs:comment ?comment}. } limit 1000
And where did you execute the query? Then I can have a look at it for myself.
Sincerely,
Mark
sory, I fogot <>. I executed it on the SPARQL endpoint.
Is it public? Can you give me the URL?
Sincerely,
Mark
sorry, It's in my localhost. I can take a screenshot for it; if you want.
Sorry, that doesn't help a lot. What data did you import to your store? Or is it a remote store?
Sincerely,
Mark
No, it's a local store. but empty. To execute the query above, must I import rdf content of the vocabulary specified in the FROM clause to the store ?
Yes, you have to import the rdf-vocabulary before you can query it. I suggest "LOAD".
Sincerely,
Mark
Thank you very much Mark. So I understand that ARC2 don't implement the FROM clause.
Regards.
I guess there is an interpretationproblem with the FROM clause. It's an additional feature of virtuoso to automatically import the data of graphs it can not find. This behaviour can be switched on and off at virtuoso. Have a look here: http://virtuoso.openlinksw.com/sparql if you don't enable "Retrieve remote RDF data for all missing source graphs" it virtuoso also returns the empty set.
Sincerely,
Mark
Thanks again. SO, I have to import the vocabulary before query it. Then when I finish, I will delete it from the store.
Regards.
Very old and it seems cleared. Please reopen if there is still a problem.
Hi, I tried to execute a sparql query containing FROM clause, the result was empty, while when I executed the same query here : http://demo.openlinksw.com/sparql/ there were a set of results.