Guest User

Untitled

a guest
Feb 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. let $results :=
  2. sem:sparql(
  3. "
  4. PREFIX skosxl: <http://www.w3.org/2008/05/skos-xl#>
  5. PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
  6. PREFIX owl: <http://www.w3.org/2002/07/owl#>
  7. PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
  8. PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  9. PREFIX slc: <http://www.smartlogic.com/2014/08/semaphore-core#>
  10.  
  11. select ?relation ?value
  12. where
  13. {
  14. $input ?relation ?c .
  15. OPTIONAL {
  16. ?c skosxl:prefLabel/skosxl:literalForm|skosxl:literalForm ?d .
  17. }
  18. BIND ( if (bound(?d), ?d, ?c) as ?value )
  19. }
  20. ", $bindings
  21. )
  22.  
  23. let $doc := <test>{
  24. for $item in $results
  25. return element {map:get($item, 'relation')} {map:get($item, 'value')}
  26. }</test>
  27.  
  28. return $doc
Add Comment
Please, Sign In to add comment