Skip to content

Instantly share code, notes, and snippets.

@jaw111

jaw111/data.csv

Created Jun 11, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.