Created
March 14, 2014 15:28
-
-
Save fancellu/9550000 to your computer and use it in GitHub Desktop.
Example of MarkLogic 7 Semantic triple query, emitting as custom XML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
let $out:=sem:sparql(' | |
SELECT * | |
WHERE { <http://dbpedia.org/resource/Debbie_Harry> ?p ?o } | |
') | |
for $i in $out | |
let $p:=map:get($i,"p") | |
let $o:=map:get($i,"o") | |
return <node name="{$p}">{$o}</node> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<node name="http://dbpedia.org/ontology/birthPlace">http://dbpedia.org/resource/Florida</node> | |
<node name="http://dbpedia.org/ontology/birthPlace">http://dbpedia.org/resource/Miami</node> | |
<node name="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">http://xmlns.com/foaf/0.1/Person</node> | |
<node name="http://xmlns.com/foaf/0.1/givenName">Deborah</node> | |
<node name="http://xmlns.com/foaf/0.1/name">Deborah Harry</node> | |
<node name="http://xmlns.com/foaf/0.1/surname">Harry</node> | |
<node name="http://dbpedia.org/ontology/birthDate">1945-07-01</node> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment