Skip to content

Instantly share code, notes, and snippets.

@jaw111
Created June 11, 2020 06:42
Show Gist options
  • Save jaw111/902a03f40eca46b685a1096fda1d3542 to your computer and use it in GitHub Desktop.
Save jaw111/902a03f40eca46b685a1096fda1d3542 to your computer and use it in GitHub Desktop.
Tarql federation example
id name
1 SPARQL
2 SQL
3 XQuery
base <http://example.com/id/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
construct {
?iri rdfs:label ?name ;
owl:sameAs ?s .
}
where {
bind(iri(?id) as ?iri)
service <https://dbpedia.org/sparql> {
?s a <http://dbpedia.org/ontology/ProgrammingLanguage> ;
rdfs:label ?label .
filter langMatches(lang(?label), "EN" )
}
filter(str(?label) = ?name)
}
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.com/id/1>
rdfs:label "SPARQL" ;
owl:sameAs <http://dbpedia.org/resource/SPARQL> .
<http://example.com/id/2>
rdfs:label "SQL" ;
owl:sameAs <http://dbpedia.org/resource/SQL> .
<http://example.com/id/3>
rdfs:label "XQuery" ;
owl:sameAs <http://dbpedia.org/resource/XQuery> .
#!/bin/bash
tarql mapping.rq data.csv > result.ttl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment