Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compact IRIs not supported in RestrictTo clauses #92

Open
jindrichmynarz opened this issue Mar 31, 2017 · 0 comments
Open

Compact IRIs not supported in RestrictTo clauses #92

jindrichmynarz opened this issue Mar 31, 2017 · 0 comments

Comments

@jindrichmynarz
Copy link
Contributor

It seems that <RestrictTo> doesn't support compact IRIs. When I use a Silk LSL with compact IRIs in <RestrictTo>, having defined their prefixes in <Prefixes> (complete linkage rule), I get this error when executing the linkage rule:

Exception in thread "main" java.lang.IllegalArgumentException: The following prefixes are not defined:  rov:, dcterms:
	at org.silkframework.entity.rdf.SparqlRestriction$.fromSparql(SparqlRestriction.scala:66)
	at org.silkframework.entity.Restriction$.custom(Restriction.scala:51)
	at org.silkframework.entity.Restriction$.parse(Restriction.scala:66)
	at org.silkframework.rule.DatasetSelection$.fromXML(DatasetSelection.scala:86)
	at org.silkframework.rule.LinkSpec$LinkSpecificationFormat$.read(LinkSpec.scala:133)
	at org.silkframework.rule.LinkSpec$LinkSpecificationFormat$.read(LinkSpec.scala:114)
	at org.silkframework.runtime.serialization.XmlSerialization$.fromXml(XmlSerialization.scala:16)
	at org.silkframework.config.Task$TaskFormat.read(Task.scala:61)
	at org.silkframework.config.Task$TaskFormat.read(Task.scala:54)
	at org.silkframework.runtime.serialization.XmlSerialization$.fromXml(XmlSerialization.scala:16)
	at org.silkframework.rule.LinkingConfig$LinkingConfigFormat$$anonfun$6.apply(LinkingConfig.scala:126)
	at org.silkframework.rule.LinkingConfig$LinkingConfigFormat$$anonfun$6.apply(LinkingConfig.scala:126)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.Iterator$class.foreach(Iterator.scala:893)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
	at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at org.silkframework.rule.LinkingConfig$LinkingConfigFormat$.readWithPrefixes(LinkingConfig.scala:126)
	at org.silkframework.rule.LinkingConfig$LinkingConfigFormat$.read(LinkingConfig.scala:115)
	at org.silkframework.rule.LinkingConfig$LinkingConfigFormat$.read(LinkingConfig.scala:102)
	at org.silkframework.runtime.serialization.XmlSerialization$.fromXml(XmlSerialization.scala:16)
	at org.silkframework.Silk$.executeFile(Silk.scala:115)
	at org.silkframework.Silk$.execute(Silk.scala:97)
	at org.silkframework.Silk$$anonfun$1.apply$mcV$sp(Silk.scala:218)
	at org.silkframework.util.CollectLogs$.apply(CollectLogs.scala:29)
	at org.silkframework.Silk$.main(Silk.scala:217)
	at org.silkframework.Silk.main(Silk.scala)

It appears that the regular expressions for parsing compact IRIs in SparqlRestriction.scala are too brittle. Perhaps it would be safer to wrap the RestrictTo in SELECT * WHERE { ... } plus the declared prefixes and having it parsed via Jena.

Tested using the latest master version (c7015f6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant