SPIN API: Support for negated property paths

46 views
Skip to first unread message

Robin Keskisärkkä

unread,
Apr 29, 2016, 10:07:18 AM4/29/16
to TopBraid Suite Users
Hi!
I need to store negated property paths using the SPIN API (), however, although ARQ parses the queries just fine I'm unable to use them to create SPIN queries. I'm using the latest version of the SPIN API (2.0.0). To exemplify:


# Using negated paths to mimic wildcard
String
qString = "PREFIX : <http://example#> SELECT ?target WHERE { :start (:|!:)* ?target }";
Query
query = QueryFactory.create(qString);
ARQ2SPIN arq2SPIN = new ARQ2SPIN(model);
org
.topbraid.spin.model.Query spinQuery = arq2SPIN.createQuery(query, null);


This gives rise to the exeption:


Exception in thread "main" java.lang.IllegalArgumentException: Unsupported Path element: !<http://example#> of type class org.apache.jena.sparql.path.P_NegPropSet
 at org
.topbraid.spin.arq.ARQ2SPIN.createPath(ARQ2SPIN.java:798)
 at org
.topbraid.spin.arq.ARQ2SPIN.createPath(ARQ2SPIN.java:769)
 at org
.topbraid.spin.arq.ARQ2SPIN.createMod(ARQ2SPIN.java:804)
 at org
.topbraid.spin.arq.ARQ2SPIN.createPath(ARQ2SPIN.java:741)
 at org
.topbraid.spin.arq.ARQ2SPIN.access$200(ARQ2SPIN.java:130)
 at org
.topbraid.spin.arq.ARQ2SPIN$1.visitElements(ARQ2SPIN.java:609)
 at org
.topbraid.spin.arq.ARQ2SPIN$1.visit(ARQ2SPIN.java:552)
 at org
.apache.jena.sparql.syntax.ElementPathBlock.visit(ElementPathBlock.java:89)
 at org
.topbraid.spin.arq.AbstractElementVisitor.visit(AbstractElementVisitor.java:82)
 at org
.topbraid.spin.arq.ARQ2SPIN$1.visit(ARQ2SPIN.java:498)
 at org
.apache.jena.sparql.syntax.ElementGroup.visit(ElementGroup.java:120)
 at org
.topbraid.spin.arq.ARQ2SPIN.createElementList(ARQ2SPIN.java:454)
 at org
.topbraid.spin.arq.ARQ2SPIN.createQuery(ARQ2SPIN.java:905)


Are negated property paths not supported in SPIN API at this point? I also looked at the vocabulary specification and couldn't find anything that indicated that it is supported.  


Cheers,

Robin

Holger Knublauch

unread,
May 1, 2016, 7:17:42 PM5/1/16
to topbrai...@googlegroups.com
Hi Robin,

negated property paths are currently not supported by the SPIN RDF syntax. I did not even know they existed, having relied on

    https://www.w3.org/TR/sparql11-property-paths/

when designing and updating the SPIN RDF syntax. At some stage, the ! operator was added to SPARQL 1.1 and SPIN was not updated accordingly.

    https://www.w3.org/TR/sparql11-query/#propertypaths

The work-around is to use the syntax based on sp:text instead of the SPIN RDF syntax.

Thanks
Holger
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), Reference Data Manager (RDM), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbrai...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin Keskisärkkä

unread,
May 4, 2016, 9:20:31 AM5/4/16
to TopBraid Suite Users
Thank, I'll use the sp:text workaround.

Cheers,
Robin
Reply all
Reply to author
Forward
0 new messages