Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let $results :=
- sem:sparql(
- "
- PREFIX skosxl: <http://www.w3.org/2008/05/skos-xl#>
- PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
- PREFIX owl: <http://www.w3.org/2002/07/owl#>
- PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
- PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
- PREFIX slc: <http://www.smartlogic.com/2014/08/semaphore-core#>
- select ?relation ?value
- where
- {
- $input ?relation ?c .
- OPTIONAL {
- ?c skosxl:prefLabel/skosxl:literalForm|skosxl:literalForm ?d .
- }
- BIND ( if (bound(?d), ?d, ?c) as ?value )
- }
- ", $bindings
- )
- let $doc := <test>{
- for $item in $results
- return element {map:get($item, 'relation')} {map:get($item, 'value')}
- }</test>
- return $doc
Add Comment
Please, Sign In to add comment