An issue with SPARQL query result

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

An issue with SPARQL query result

jfwei1992
Hi all,

I am new to Owlready2 and trying to query my ontology with SPARQL. However, I am not able to gain anything from the query. For example, the following query

g = default_world.as_rdflib_graph()

query_string = '''
SELECT ?a ?b
WHERE
        {
        ?a ?b "true"^^xsd:boolean.}'''

r = g.query(query_string)

should at least return some results (the same query string is tested with Stardog). This only happens when boolean value is involved. Is there anyway to make this work?


Kind regards,

Jin
Reply | Threaded
Open this post in threaded view
|

Re: An issue with SPARQL query result

Jiba
Administrator
Hi,

You are right, there was a bug on boolean in Owlready's RDFlib support (and thus affecting SPARQL).

I've just fixed the bug in the development version.

As a work-around, you can also remove the boolean type in your request:

query_string = '''
SELECT ?a ?b
WHERE {?a ?b "true".}'''

Best regards,
Jiba
Reply | Threaded
Open this post in threaded view
|

Re: An issue with SPARQL query result

jfwei1992
Thanks! It works as expected. I will try the development version out soon.

Kind regards,

Jin

On 26 Nov 2018, at 18:12, Jiba [via Owlready] <[hidden email]> wrote:

Hi,

You are right, there was a bug on boolean in Owlready's RDFlib support (and thus affecting SPARQL).

I've just fixed the bug in the development version.

As a work-around, you can also remove the boolean type in your request:

query_string = '''
SELECT ?a ?b
WHERE {?a ?b "true".}'''

Best regards,
Jiba


If you reply to this email, your message will be added to the discussion below:
http://owlready.8326.n8.nabble.com/An-issue-with-SPARQL-query-result-tp672p673.html
To unsubscribe from An issue with SPARQL query result, click here.
NAML