Skip to content

Add support for literals with language tags to the GenericRuleReasoner's rules syntax #3042

Open
@bnouwt

Description

@bnouwt

Version

5.3.0

Feature

Loading the following rule with the Rule.parseRules(...) method gives an error.

-> (<http://example.org/#spiderman> <http://xmlns.com/foaf/0.1/name> "Человек-паук"@ru) .
org.apache.jena.reasoner.rulesys.Rule$ParserException: Triple with 4 nodes!
At '-> ( <http://example.org/#spiderman> <http://xmlns.com/foaf/0.1/name> " Человек-паук " @ru ) '
	at org.apache.jena.reasoner.rulesys.Rule$Parser.parseClause(Rule.java:1016)
	at org.apache.jena.reasoner.rulesys.Rule$Parser.doParseRule(Rule.java:1081)
	at org.apache.jena.reasoner.rulesys.Rule$Parser.parseRule(Rule.java:1046)
	at org.apache.jena.reasoner.rulesys.Rule.parseRules(Rule.java:664)
	at org.apache.jena.reasoner.rulesys.Rule.parseRules(Rule.java:678)
	at org.apache.jena.reasoner.rulesys.Rule.parseRules(Rule.java:690)
        ...
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

After checking the source it seems like literals with language tags are not supported by the current Rule syntax.

We ran into this issue because we are trying to convert a string with RDF in turtle format into a string with every triple converted into the following Apache Jena's rule format:

-> ( <subject> <predicate> <object> ) .

The lack of support for language tags is currently not blocking for us.

Are you interested in contributing a solution yourself?

Perhaps?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIncrementally add new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions