<#TriplesMapX> rml:logicalSource <#InputX> .
@prefix hydra : <http://www.w3.org/ns/hydra/core#> .
<#InputX>
rml:source <#API_template_source> ;
rml:referenceFormulation ql:JSON;
rml:iterator "$".
<#API_template_source>
a hydra:IriTemplate
hydra:template "https://biblio.ugent.be/publication/{id}?format={format}";
hydra:mapping
[ a hydra:TemplateMapping ;
hydra:variable "id";
hydra:required true ],
[ a hydra:TemplateMapping ;
hydra:variable "format";
hydra:required false ] .
@prefix rml : <http://semweb.mmlab.be/rml#> .
@prefix d2rq : <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
<#TriplesMapV> rml:logicalSource <#InputV> .
<#InputV>
rml:source <#DB_source> ;
rr:sqlVersion rr:SQL2008;
rr:sqlQuery """
SELECT DEPTNO, DNAME, LOC,
(SELECT COUNT(*) FROM EMP WHERE EMP.DEPTNO = %%DEPTNO%%) AS STAFF
FROM DEPT; """ .
<#DB_source>
a d2rq:Database;
d2rq:jdbcDSN "jdbc:mysql://localhost/example";
d2rq:jdbcDriver "com.mysql.jdbc.Driver";
d2rq:username "username";
d2rq:password "password" .
@prefix rml : <http://semweb.mmlab.be/rml#> .
@prefix sd : <http://www.w3.org/ns/sparql-service-description#> .
<#TriplesMapT> rml:logicalSource <#InputT> .
<#InputT>
rml:source <#SPARQL_source> ;
rml:referenceFormulation ql:XML;
rml:iterator "/";
rml:query " select distinct ?resource ?resource_label
where { ?resource rdfs:label %%label%% } " .
<#SPARQL_source>
a sd:Service ;
sd:endpoint <http://dbpedia.org/sparql/> ;
sd:supportedLanguage sd:SPARQL11Query ;
sd:resultFormat <http://www.w3.org/ns/formats/SPARQL_Results_XML> .
@prefix rml : <http://semweb.mmlab.be/rml#> .
@prefix d2rq : <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
<#TriplesMapA>
rr:predicateObjectMap [
rr:predicate foaf:account;
rr:objectMap [
rr:parentTriplesMap <#TriplesMapB> ;
crml:bindCondition
[ rml:reference "id_number" ;
crml:condition "id" ],
[ rr:constant "json" ;
crml:condition "format" ]]].
<#TriplesMapB> rml:logicalSource <#InputB> ;
rr:subjectMap [
rr:template "http://ex.com/{account_ID}" ] .
<#InputB>
rml:source <#API_template_source>;
rml:referenceFormulation ql:JSONPath.
<#API_template_source>
a hydra:IriTemplate
hydra:template "https://biblio.ugent.be/publication/{id}?format={format}";
hydra:mapping
[ a hydra:TemplateMapping ;
hydra:variable "id";
hydra:required true ],
[ a hydra:TemplateMapping ;
hydra:variable "format";
hydra:required false ] .