Rules allowing literal into subject position

1 view
Skip to first unread message

Zachary Whitley

unread,
Mar 15, 2016, 12:50:16 PM3/15/16
to Stardog
I made a mistake while constructing a user defined rule and noticed this bug. It appears that Stardog is allowing literals in the subject position as the result of a user defined rule.

Stardog version 4.0.5
Nothing to report in logs

$> stardog-admin db create -n test -- literal-in-subject-from-rule.ttl

$> cat literal-in-subject-from-rule.ttl

@prefix rule: <tag:stardog:api:rule:> .

:a :number 5 .

[]
    a rule:SPARQLRule ;
    rule:content """
   
    IF {
        ?a :number ?n .
    } THEN {
        ?n a :Number .
    }
"""
.


$> stardog query execute -r "SELECT * WHERE { ?s ?p ?o }

+-------+----------+-----------+
|   s   |    p     |     o     |
+-------+----------+-----------+
| :a    | :number  | 5         |
| 5     | rdf:type | :Number   |
| :a    | rdf:type | owl:Thing |
+-------+----------+-----------+


# since open ?s ?p ?o queries seem to be problematic at times I also tried the following with the same error

$> stardog query execute -r "SELECT * WHERE { ?s ?p :Number }

+-------+----------+
|   s   |    p     |
+-------+----------+
| 5     | rdf:type |
+-------+----------+

$> stardog query execute -r "SELECT * WHERE { ?s :a :Number }

+-------+
|   s   |
+-------+
| 5     |
+-------+

literal-in-subject-from-rule.ttl

Evren Sirin

unread,
Mar 17, 2016, 9:07:03 AM3/17/16
to Stardog
We had another variation of this problem before (#2219) which was
fixed in 4.0 but looks like there are still some cases that is not
covered. Thanks for the report and we will take a look at this.

Best,
Evren
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
Reply all
Reply to author
Forward
0 new messages