ropensci / rdflib

:package: High level wrapper around the redland package for common rdf applications
https://docs.ropensci.org/rdflib
Other
57 stars 9 forks source link

Sparql path properties in rdflib #32

Open sergeitarasov opened 4 years ago

sergeitarasov commented 4 years ago

Hi, I wonder if R rdflib supports path properties in sparql queries, e.g., '+', '*', '/', etc? For example, I tried few queries:

WHERE { dry:phenotype_17956 rdfs:subClassOf/rdfs:subClassOf ?x . }'

WHERE { dry:phenotype_17956 rdfs:subClassOf* ?x . }'

and all of them return the same error about the syntax:

librdf error - syntax error, unexpected '/' rdf_query_results.c:422: (librdf_query_results_to_string2) assertion failed: object pointer of type librdf_query_results is NULL. Error: file must be a string, raw vector or a connection.

Cheers, Sergei

amoeba commented 4 years ago

Hi @sergeitarasov: rdflib is built on the redlands R package which is built on the redlands library which uses the Rasqal library for SPARQL queries which does not support Property Path expressions. See "Supported Query Languages" on that page. I think that explains your error.

sergeitarasov commented 4 years ago

ok! Thanks for the prompt reply!

cboettig commented 4 years ago

Thanks @amoeba ! @sergeitarasov , just in case it is helpful, Bryce and I have an alternative R package, https://github.com/ropensci/virtuoso, which uses virtuoso instead of redlands as the backend. I haven't actually tried Property Path expressions in virtuoso either, but have often found it covers cases that redlands library does not.

amoeba commented 4 years ago

Good call, @cboettig. I'd bet they work there.

sergeitarasov commented 4 years ago

Thanks @cboettig ! I've just tried Virtuoso and it supports, at least some (like '/'), path expression.