semsol / arc2

ARC RDF Classes for PHP
Other
332 stars 89 forks source link

I Can't execute queries with FROM clause #7

Closed Nasreddine closed 5 years ago

Nasreddine commented 13 years ago

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.

Knurg commented 13 years ago

Hi Nesreddine,

what query did you want to execute? Please provide some more information.

Sincerely,

Mark

Nasreddine commented 13 years ago

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.

Knurg commented 13 years ago

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

Nasreddine commented 13 years ago

sory, I fogot <>. I executed it on the SPARQL endpoint.

Knurg commented 13 years ago

Is it public? Can you give me the URL?

Sincerely,

Mark

Nasreddine commented 13 years ago

sorry, It's in my localhost. I can take a screenshot for it; if you want.

Knurg commented 13 years ago

Sorry, that doesn't help a lot. What data did you import to your store? Or is it a remote store?

Sincerely,

Mark

Nasreddine commented 13 years ago

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 ?

Knurg commented 13 years ago

Yes, you have to import the rdf-vocabulary before you can query it. I suggest "LOAD".

Sincerely,

Mark

Nasreddine commented 13 years ago

Thank you very much Mark. So I understand that ARC2 don't implement the FROM clause.

Regards.

Knurg commented 13 years ago

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

Nasreddine commented 13 years ago

Thanks again. SO, I have to import the vocabulary before query it. Then when I finish, I will delete it from the store.

Regards.

k00ni commented 5 years ago

Very old and it seems cleared. Please reopen if there is still a problem.