SWRL Rule - swrlb:substringBefore - cannot convert value of type PlainLiteral to xsd:string

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SWRL Rule - swrlb:substringBefore - cannot convert value of type PlainLiteral to xsd:string

anacrl
This post was updated on .
Sirs,
I created some SWRL rules in old version of the Protege.
When I opened in the new version, the rules dont execute more.
For example, I have this rule:
tuning:SingleStatement(?stat) ^ tuning:hasDescription(?stat, ?desc) ^
swrlb:substringBefore(?subBefore, ?desc, "GROUP BY"^^rdf:PlainLiteral) ^
swrlb:substringAfter(?subAfter, ?subBefore, "WHERE"^^rdf:PlainLiteral) ^
swrlb:stringConcat(?clause, "WHERE"^^rdf:PlainLiteral, ?subAfter) ^
swrlx:makeOWLThing(?where, ?clause) ^ swrlb:tokenize(?columns, ?subAfter, "
"^^rdf:PlainLiteral) ^ tuning:Column(?col) ^ tuning:hasName(?col, ?colName)
^ swrlb:matches(?columns, ?colName) -> tuning:Where(?where) ^
tuning:hasDescription(?where, ?clause) ^ tuning:hasClause(?stat, ?where) ^
tuning:ReferencedColumn(?col) ^ tuning:references(?where, ?col)

When I opened in the new version, the Protege rewrite the SWRL rule putting
^^rdf:PlainLiteral after ". Why?
So, I get this error:

Exception running rule engine: error inserting asserted OWL axioms into
Drools:
[Error: invoker.invoke("RuleWhereClause", "swrlb:substringBefore", 0, false,
new VPATH(), new BAVNs("subBefore", "desc", ""), new UBA("subBefore"),
$desc, new L("GROUP BY", "rdf:PlainLiteral")): built-in exception thrown by
built-in swrlb:substringBefore in rule RuleWhereClause: exception thrown by
built-in swrlb:substringBefore in rule RuleWhereClause: cannot convert value
of type PlainLiteral to xsd:string]
[Near : {... invoker.invoke("RuleWhereClaus ....}]

Why this is happen? Could you help me, please?
Thanks.



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
protege-user@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: cannot convert value of type PlainLiteral to xsd:string

Martin O'Connor-2
Which version of Protege?

Can you email the ontology to me.

Martin

> On Jan 24, 2019, at 07:36, anacrl <[hidden email]> wrote:
>
> Sirs,
> I created some SWRL rules in old version of the Protege.
> When I opened in the new version, the rules dont execute more.
> For example, I have this rule:
> tuning:SingleStatement(?stat) ^ tuning:hasDescription(?stat, ?desc) ^
> swrlb:substringBefore(?subBefore, ?desc, "GROUP BY"^^rdf:PlainLiteral) ^
> swrlb:substringAfter(?subAfter, ?subBefore, "WHERE"^^rdf:PlainLiteral) ^
> swrlb:stringConcat(?clause, "WHERE"^^rdf:PlainLiteral, ?subAfter) ^
> swrlx:makeOWLThing(?where, ?clause) ^ swrlb:tokenize(?columns, ?subAfter, "
> "^^rdf:PlainLiteral) ^ tuning:Column(?col) ^ tuning:hasName(?col, ?colName)
> ^ swrlb:matches(?columns, ?colName) -> tuning:Where(?where) ^
> tuning:hasDescription(?where, ?clause) ^ tuning:hasClause(?stat, ?where) ^
> tuning:ReferencedColumn(?col) ^ tuning:references(?where, ?col)
>
> When I opened in the new version, the Protege rewrite the SWRL rule putting
> ^^rdf:PlainLiteral after ". Why?
> So, I get this error:
>
> Exception running rule engine: error inserting asserted OWL axioms into
> Drools:
> [Error: invoker.invoke("RuleWhereClause", "swrlb:substringBefore", 0, false,
> new VPATH(), new BAVNs("subBefore", "desc", ""), new UBA("subBefore"),
> $desc, new L("GROUP BY", "rdf:PlainLiteral")): built-in exception thrown by
> built-in swrlb:substringBefore in rule RuleWhereClause: exception thrown by
> built-in swrlb:substringBefore in rule RuleWhereClause: cannot convert value
> of type PlainLiteral to xsd:string]
> [Near : {... invoker.invoke("RuleWhereClaus ....}]
>
> Why this is happen? Could you help me, please?
> Thanks.
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: cannot convert value of type PlainLiteral to xsd:string

anacrl
Martin,

I dont remember the version that this rule worked. I think it is before of
the 5.1.0 version.

I changed the prefix name too because of the new version of the Protege.

What's your e-mail? I cant reply this message.

Thanks,

Ana Carolina



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user