On 16/03/2020 08:49, Luis Enrique Ramos García wrote:
Hi Dave,

thanks for your quick response,

I though that was the cause of the problem, however when I add the bind to
?ord in the body, then the rule is not triggered , I changed  as in rule 1:


String rule 1=  (?b rdf_ns:type  GLEIF1_NS Entity)  (?b GLEIF1_NS has_ord
?ord) (?b GLEIF1_NS registration_Authority_entity_ID "search_ID') -> (?b
GLEIF1_NS has_ord ?ord)

What's that supposed to do? You seem to be binding ?ord then asserting the same value back again. So that will have no effect on the data.

String rule 2=  (?b rdf_ns:type  GLEIF1_NS Entity)  (?b GLEIF1_NS
registration_Authority_entity_ID "search_ID') -> (?b GLEIF1_NS has_ord ?ord)

What's that supposed to do? There's no binding for ?ord so why would you expect it to have a specific value?

as shown above the rule 1 does not trigger, rule 2 does trigger as
expected, but the output value does not corresponds to the value of ?ord. I
obtained this value > *ae791d81-7538-49ac-9436-898ede09d7b5*], and should
have been > ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID0000080614]

Sorry I can't follow what you are attempting to do. Tou aren't showing us the actual data (with namespaces) or actual rules (with all these variables expanded) so it's hard to spot the details. Also unclear what you mean by "output", whether you are looking at a dump of the whole model, just the deductions graph or something else.

How you do you know the first rule isn't firing? Since it makes no change to the data it's going to be hard to tell. Use the print builtin to help debug.

If you can't work it out then generate a minimal complete test case with just minimal test data (ideally in turtle with all prefixes defined) and minimal rule example (actual rule, not source code snippet that generates the rule) then post that. Then maybe someone can spot what's happening.

Dave

El lun., 16 mar. 2020 a las 9:13, Dave Reynolds (<[email protected]>)
escribió:


On 16/03/2020 06:58, Luis Enrique Ramos García wrote:
Dear friends,

I am running a rule in a data set, which has the following format:

    <j.0:Entity rdf:about="
http://www.example.com/onto/gleif1.owl#097900BHID0000080614";>
      <rdfs:label

xml:lang="ia">ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID0000080614]</rdfs:label>
      <rdfs:label xml:lang="en">scope s.r.o.</rdfs:label>


<j.0:registration_Authority_entity_ID>search_ID</j.0:registration_Authority_entity_ID>

<j.0:registration_Authority_ID>RA000526</j.0:registration_Authority_ID>
      <j.0:legal_Name>scope s.r.o.</j.0:legal_Name>
*

<j.0:has_ord>ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID0000080614]</j.0:has_ord>*
      <owl:versionInfo>1</owl:versionInfo>


where I want to obtain the *has_ord* property value with the rule:

   String rule_rid= "[rule1: (?b "+rdf_ns+"type "+GLEIF1_NS+"Entity) "
+ "(?b "+GLEIF1_NS+"registration_Authority_entity_ID
"+"'"+search_ID+"')"//get all gleif entities ID
+ "-> (?b "+GLEIF1_NS+"has_ord ?ord)]";//put the output

That's very hard to read but unless I'm missing something there's
nothing in the body of the rule to bind ?ord.

Dave


The rule is triggered as expected, however the value in the output does
not
corresponds to the real value:

output:

http://www.example.com/onto/gleif1.owl#has_ord,
*ae791d81-7538-49ac-9436-898ede09d7b5*]

but, it should be:

http://www.example.com/onto/gleif1.owl#has_ord,*
ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID0000080614]
]*


I am running the jena rule against a model stored in a tdb database.

Thanks in advanced for your support.


Luis Ramos



Reply via email to