You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building a property path using PropertyPathBuilder, the path contains spaces, e.g. after operators such as +. It appears that AllegroGraph does not like that.
Looking in the SPARQL specs, it seems that there should not be spaces before postfix operators (like '+') or after prefix operators ('^').
AllegroGraph is the only SPARQL backend I have seen so far that seems to be picky on this issue.
Expected Behavior
PropertyPathBuilder should generate standards-compliant property paths.
Steps To Reproduce
Ok, this is tricky - you'd need an AllegroGraph instance to actually reproduce it. But I'll give you examples.
This query constructed using the RDF4J API fails:
Query :
SELECT DISTINCT ?subj
FROM <http://testgraph>
WHERE { { { ?subj <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> + <http://example.org/#property-1> .
FILTER EXISTS { { ?subj <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> . } UNION { ?subj <http://www.w3.org/2000/01/rdf-schema#subClassOf> + <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> . } UNION { [] <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> ?subj . } UNION { ?subj <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> [] . } } } } }
LIMIT 200
----
org.eclipse.rdf4j.query.QueryEvaluationException: Line 3, Found !<HTTP://EXAMPLE.ORG/#PROPERTY-1> (of type q_iri_ref). Was expecting one of: DECIMAL-POSITIVE, DOUBLE-POSITIVE, INTEGER-POSITIVE. while running query:
SELECT DISTINCT ?subj
FROM <http://testgraph>
WHERE { { { ?subj <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> + <http://example.org/#property-1> .
FILTER EXISTS { { ?subj <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> . } UNION { ?subj <http://www.w3.org/2000/01/rdf-schema#subClassOf> + <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> . } UNION { [] <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> ?subj . } UNION { ?subj <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> [] . } } } } }
LIMIT 200
This query works after I have adjusted classes such as org.eclipse.rdf4j.sparqlbuilder.constraint.propertypath.OneOrMorePath to not add a space:
Query :
SELECT DISTINCT ?subj
FROM <http://testgraph>
WHERE { { { ?subj <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>+ <http://example.org/#property-1> .
FILTER EXISTS { { ?subj <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> . } UNION { ?subj <http://www.w3.org/2000/01/rdf-schema#subClassOf>+ <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> . } UNION { [] <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> ?subj . } UNION { ?subj <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> [] . } } } } }
LIMIT 200
Results : 2 in 520ms
KBHandle[identifier=http://example.org/#subproperty-1-1,name=<null>]
KBHandle[identifier=http://example.org/#subproperty-1-1-1,name=<null>]
Version
4.3.9
Are you interested in contributing a solution yourself?
Perhaps?
Anything else?
I can provide a PR to remove the spaces, but I'd prefer not having to produce a full unit test for this as this would involve booting up an AllegroGraph, filling it with data and testing queries against it.
Tested against Docker image franzinc/agraph:latest (ID sha256:5c3cf4887ecf832a68fb94360edfae57cf3506d3604864967266362f8a733189)
The text was updated successfully, but these errors were encountered:
Current Behavior
When building a property path using
PropertyPathBuilder
, the path contains spaces, e.g. after operators such as+
. It appears that AllegroGraph does not like that.Looking in the SPARQL specs, it seems that there should not be spaces before postfix operators (like '+') or after prefix operators ('^').
AllegroGraph is the only SPARQL backend I have seen so far that seems to be picky on this issue.
Expected Behavior
PropertyPathBuilder
should generate standards-compliant property paths.Steps To Reproduce
Ok, this is tricky - you'd need an AllegroGraph instance to actually reproduce it. But I'll give you examples.
This query constructed using the RDF4J API fails:
This query works after I have adjusted classes such as
org.eclipse.rdf4j.sparqlbuilder.constraint.propertypath.OneOrMorePath
to not add a space:Version
4.3.9
Are you interested in contributing a solution yourself?
Perhaps?
Anything else?
I can provide a PR to remove the spaces, but I'd prefer not having to produce a full unit test for this as this would involve booting up an AllegroGraph, filling it with data and testing queries against it.
Tested against Docker image
franzinc/agraph:latest
(ID sha256:5c3cf4887ecf832a68fb94360edfae57cf3506d3604864967266362f8a733189)The text was updated successfully, but these errors were encountered: