Suppose I have two xml documents : Document 1:
<item>
<item_id> 001 </item_id>
<color>blue</color>
</item>
Document 2:
<item>
<item_ref_id>abc</item_ref_id>
<color>blue</color>
</item>
Now for inferencing, I will define a triple as:
<item_ref_id> <http://www.w3.org/2002/07/owl#sameAs> <item_id>
If I write a SPARQL query for fetching document2 with <item_id>
= abc, it should work.
Is this possible via inferencing, how can we do this kind of stuff through MarkLogic.
What all triples are needed to achieve this?
Updating the approach which i used as:
import module namespace sem = "http://marklogic.com/semantics" at
"/MarkLogic/semantics.xqy";
declare namespace s = "http://www.w3.org/2005/sparql-results#";
for $doc in sem:query-results-serialize(sem:sparql( "SELECT ?s WHERE
{?s <http://www.w3.org/2002/07/owl#sameAs>
<productId>}"),"xml")//s:uri/text()
return cts:element-value-query(xs:QName($doc), '001')
The result which i get from this is:
cts:element-value-query(fn:QName("","id"), "001", ("lang=en"), 1)
cts:element-value-query(fn:QName("","productId"), "001", ("lang=en"), 1)
I have few questions regarding this: 1. Is my approach correct for solving this scenario which i have mentioned above ? 2. I am not able to use the result of sparql query and expand the query for searching the document, can you please update what i am doing wrong in this?