RMLio / social-media-archiving

A sustainable workflow for Knowledge Graph-based social media archiving reusing open source components.
3 stars 0 forks source link

Where are set the ${VARIABLE} variables ? #22

Open JBPressac opened 2 years ago

JBPressac commented 2 years ago

Hello,

I noticed that https://github.com/RMLio/social-media-archiving/blob/b0d0cd31ad12d935ed474f9544e04c4a0691c103/mappings/collection-harvest-seeds.yml for instance uses variables as ${SFM_DB_HOST}, ${SFM_DB_PORT} or ${SFM_DB_DATABASE} but where does those variables come from ? Where are they set ?

I am using RMLmapper. Does this kind of variables would work with this application ?

Thanks,

pheyvaer commented 2 years ago

Hi @JBPressac

They are used by the Social Feed Manager. They are explained at https://sfm.readthedocs.io/en/stable/install.html When you generate RML rules from the YARRRML rules, you need to provide them to the YARRRML Parser using -e parameter.

SvenLieber commented 2 years ago

Hi @JBPressac

indeed, as @pheyvaer said they are used by the Social Feed Manager. However, I am not 100% sure that passing the variables with -e will work with the mapping files in this repository out of the box, because I used the curly braces notation => ${..}.

I did this because I have assigned values to these variables in a .env file and used a fork of yarrrml which automatically loads the variables from a found .env file.

Thus for the -e solution proposed by Pieter used by the most up-to-date yarrrml-parser, you may have to adapt the syntax of the variable within the yarrrml file, for example $(_SFM_DB_HOST) (see the documentation linked by @pheyvaer ).

JBPressac commented 2 years ago

Hello,

Thank you for your answers. However, @SvenLieber, the -e parameter does not work with references set in the variables part of a .yml file (with the YARRRRM Parser version 1.3.4).

For instance, yarrrml-parser -i rules-prelib.yml -o rules-prelib.rml.ttl -e username=John applied to:

# rules-prelib.yml
prefixes:
 idlab-fn: http://example.com/idlab/function/
 grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 
 crm: http://www.cidoc-crm.org/cidoc-crm/
 idref: https://www.idref.fr/
 frbroo: http://iflastandards.info/ns/fr/frbr/frbroo/
 prelib: http://mshb.huma-num.fr/prelib/
 lexvo: http://lexvo.org/id/iso639-3/
 sdh: https://ontome.net/ns/sdhss/
 sdh-so: https://ontome.net/ns/social-life-specific/
 wd: http://www.wikidata.org/entity/ 

variables:
  access: &dbHost http://localhost/django_mshb
  type: &dbType mysql
  referenceFormulation: &csvReferenceFormulation csv
  credentials: &credentials
    username: $(_username)
    password: $(_password)

sources:
 prelib_airegeographique:
  access: *dbHost
  credentials: *credentials
  type: *dbType
  referenceFormulation: *csvReferenceFormulation   
  query : SELECT * FROM prelib_airegeographique; 
 prelib_appellationpersonne:
  access: *dbHost
  credentials: *credentials
  type: *dbType
  referenceFormulation: *csvReferenceFormulation   
  query : SELECT * FROM prelib_appellationpersonne JOIN prelib_langue ON prelib_langue.id = prelib_appellationpersonne.langue_id;
 prelib_collectif:
  access: *dbHost
  credentials: *credentials
  type: *dbType
  referenceFormulation: *csvReferenceFormulation   
  query : SELECT * FROM prelib_collectif;
 prelib_oeuvre:
  access: *dbHost
  credentials: *credentials
  type: *dbType
  referenceFormulation: *csvReferenceFormulation   
  query : SELECT * FROM prelib_oeuvre;
 prelib_oeuvrelangue:
  access: *dbHost
  credentials: *credentials
  type: *dbType
  referenceFormulation: *csvReferenceFormulation   
  query : SELECT * FROM prelib_oeuvrelangue JOIN prelib_langue WHERE prelib_langue.id = prelib_oeuvrelangue.langue_id;     
 prelib_personne:
  access: *dbHost
  credentials: *credentials
  type: *dbType
  referenceFormulation: *csvReferenceFormulation
  query: SELECT * FROM prelib_personne;  
 prelib_profession:
  access: *dbHost
  credentials: *credentials
  type: *dbType
  referenceFormulation: *csvReferenceFormulation   
  query : SELECT * FROM prelib_profession;  

mappings:
 PersonnesMapping:
  sources: prelib_personne
  subjects: prelib:personne/$(id)
  predicateobjects:
   - [a, crm:E21_Person]
   - [rdfs:label, $(nom_usuel)]

 AppellationsRetenuesPersonnesMapping:
  sources: prelib_appellationpersonne
  subjects: prelib:personne/$(personne_id)
  predicateobjects:
   - [skos:prefLabel, $(appellation), $(code_iso_639_3)~lang]
  condition:
    function: idlab-fn:equal
    parameters:
     - [grel:valueParameter, $(forme)]
     - [grel:valueParameter2, "2"]     

 AppellationsRejetteesPersonnesMapping:
  sources: prelib_appellationpersonne
  subjects: prelib:personne/$(personne_id)
  predicateobjects:
   - [skos:altLabel, $(appellation), $(code_iso_639_3)~lang]
  condition:
    function: idlab-fn:equal
    parameters:
     - [grel:valueParameter, $(forme)]
     - [grel:valueParameter2, "1"]    

 CollectifsMapping:
  sources: prelib_collectif
  subjects: prelib:collectif/$(id)
  predicateobjects:
   - [a, crm:E74_Group]
   - [rdfs:label, $(nom)]

 OccupationMapping:
  sources: prelib_profession
  subjects: prelib:occupation/$(id)
  predicateobjects:
   - [a, sdh-so:C8]
   - [sdh-so:P7_on_behalf_of, prelib:personne/$(personne_id)~iri]

 OeuvresMapping:
  sources: prelib_oeuvre
  subjects: prelib:oeuvre/$(id)
  predicateobjects:
   - [a, frbroo:F2]
   - [a, crm:E33_Linguistic_Object]
   - [rdfs:label, $(titre)]

 OeuvresLanguesMapping:
  sources: prelib_oeuvrelangue
  subjects: prelib:oeuvre/$(oeuvre_id)
  predicateobjects:
   - [crm:P72_has_language, lexvo:$(code_iso_639_3)~iri]

 AiresGeographiquesMapping:
  sources: prelib_airegeographique
  subjects: prelib:airegeographique/$(id)
  predicateobjects:
   - [a, sdh:C13_Geographical_Place]
   - [rdfs:label, $(nom)]
   - [owl:sameAs, wd:$(wikidata)~iri]

...generates the following rules-prelib.rml.ttl file:

@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix fnml: <http://semweb.mmlab.be/ns/fnml#>.
@prefix fno: <https://w3id.org/function/ontology#>.
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#>.
@prefix void: <http://rdfs.org/ns/void#>.
@prefix dc: <http://purl.org/dc/terms/>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@prefix ql: <http://semweb.mmlab.be/ns/ql#>.
@prefix : <http://mapping.example.com/>.
@prefix idlab-fn: <http://example.com/idlab/function/>.
@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#>.
@prefix crm: <http://www.cidoc-crm.org/cidoc-crm/>.
@prefix idref: <https://www.idref.fr/>.
@prefix frbroo: <http://iflastandards.info/ns/fr/frbr/frbroo/>.
@prefix prelib: <http://mshb.huma-num.fr/prelib/>.
@prefix lexvo: <http://lexvo.org/id/iso639-3/>.
@prefix sdh: <https://ontome.net/ns/sdhss/>.
@prefix sdh-so: <https://ontome.net/ns/social-life-specific/>.
@prefix wd: <http://www.wikidata.org/entity/>.

:rules_000 a void:Dataset.
:source_000 a rml:LogicalSource;
    rdfs:label "prelib_airegeographique";
    rml:source :database_000;
    rml:query "SELECT * FROM prelib_airegeographique;".
:database_000 a d2rq:Database;
    d2rq:jdbcDSN "http://localhost/django_mshb";
    d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
    d2rq:username "$(_username)";
    d2rq:password "$(_password)".
:source_000 rml:referenceFormulation ql:CSV.
:source_001 a rml:LogicalSource;
    rdfs:label "prelib_appellationpersonne";
    rml:source :database_001;
    rml:query "SELECT * FROM prelib_appellationpersonne JOIN prelib_langue ON prelib_langue.id = prelib_appellationpersonne.langue_id;".
:database_001 a d2rq:Database;
    d2rq:jdbcDSN "http://localhost/django_mshb";
    d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
    d2rq:username "$(_username)";
    d2rq:password "$(_password)".
:source_001 rml:referenceFormulation ql:CSV.
:source_002 a rml:LogicalSource;
    rdfs:label "prelib_collectif";
    rml:source :database_002;
    rml:query "SELECT * FROM prelib_collectif;".
:database_002 a d2rq:Database;
    d2rq:jdbcDSN "http://localhost/django_mshb";
    d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
    d2rq:username "$(_username)";
    d2rq:password "$(_password)".
:source_002 rml:referenceFormulation ql:CSV.
:source_003 a rml:LogicalSource;
    rdfs:label "prelib_oeuvre";
    rml:source :database_003;
    rml:query "SELECT * FROM prelib_oeuvre;".
:database_003 a d2rq:Database;
    d2rq:jdbcDSN "http://localhost/django_mshb";
    d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
    d2rq:username "$(_username)";
    d2rq:password "$(_password)".
:source_003 rml:referenceFormulation ql:CSV.
:source_004 a rml:LogicalSource;
    rdfs:label "prelib_oeuvrelangue";
    rml:source :database_004;
    rml:query "SELECT * FROM prelib_oeuvrelangue JOIN prelib_langue WHERE prelib_langue.id = prelib_oeuvrelangue.langue_id;".
:database_004 a d2rq:Database;
    d2rq:jdbcDSN "http://localhost/django_mshb";
    d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
    d2rq:username "$(_username)";
    d2rq:password "$(_password)".
:source_004 rml:referenceFormulation ql:CSV.
:source_005 a rml:LogicalSource;
    rdfs:label "prelib_personne";
    rml:source :database_005;
    rml:query "SELECT * FROM prelib_personne;".
:database_005 a d2rq:Database;
    d2rq:jdbcDSN "http://localhost/django_mshb";
    d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
    d2rq:username "$(_username)";
    d2rq:password "$(_password)".
:source_005 rml:referenceFormulation ql:CSV.
:source_006 a rml:LogicalSource;
    rdfs:label "prelib_profession";
    rml:source :database_006;
    rml:query "SELECT * FROM prelib_profession;".
:database_006 a d2rq:Database;
    d2rq:jdbcDSN "http://localhost/django_mshb";
    d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
    d2rq:username "$(_username)";
    d2rq:password "$(_password)".
:source_006 rml:referenceFormulation ql:CSV.
:rules_000 void:exampleResource :map_PersonnesMapping_000.
:map_PersonnesMapping_000 rml:logicalSource :source_005;
    a rr:TriplesMap;
    rdfs:label "PersonnesMapping".
:s_000 a rr:SubjectMap.
:map_PersonnesMapping_000 rr:subjectMap :s_000.
:s_000 rr:template "http://mshb.huma-num.fr/prelib/personne/{id}".
:pom_000 a rr:PredicateObjectMap.
:map_PersonnesMapping_000 rr:predicateObjectMap :pom_000.
:pm_000 a rr:PredicateMap.
:pom_000 rr:predicateMap :pm_000.
:pm_000 rr:constant rdf:type.
:pom_000 rr:objectMap :om_000.
:om_000 a rr:ObjectMap;
    rr:constant "http://www.cidoc-crm.org/cidoc-crm/E21_Person";
    rr:termType rr:IRI.
:pom_001 a rr:PredicateObjectMap.
:map_PersonnesMapping_000 rr:predicateObjectMap :pom_001.
:pm_001 a rr:PredicateMap.
:pom_001 rr:predicateMap :pm_001.
:pm_001 rr:constant rdfs:label.
:pom_001 rr:objectMap :om_001.
:om_001 a rr:ObjectMap;
    rml:reference "nom_usuel";
    rr:termType rr:Literal.
:rules_000 void:exampleResource :map_AppellationsRetenuesPersonnesMapping_000.
:map_AppellationsRetenuesPersonnesMapping_000 rml:logicalSource :source_001;
    a rr:TriplesMap;
    rdfs:label "AppellationsRetenuesPersonnesMapping".
:s_001 a rr:SubjectMap.
:map_AppellationsRetenuesPersonnesMapping_000 rr:subjectMap :s_001.
:s_001 a fnml:FunctionTermMap;
    rr:termType rr:IRI;
    fnml:functionValue :fn_000.
:fn_000 rml:logicalSource :source_001;
    rr:predicateObjectMap :pomexec_000.
:pomexec_000 rr:predicateMap :pmexec_000.
:pmexec_000 rr:constant fno:executes.
:pomexec_000 rr:objectMap :omexec_000.
:omexec_000 rr:constant "http://example.com/idlab/function/trueCondition";
    rr:termType rr:IRI.
:fn_000 rr:predicateObjectMap :pom_002.
:pom_002 a rr:PredicateObjectMap;
    rr:predicateMap :pm_002.
:pm_002 a rr:PredicateMap;
    rr:constant idlab-fn:strBoolean.
:pom_002 rr:objectMap :om_002.
:om_002 a rr:ObjectMap, fnml:FunctionTermMap;
    fnml:functionValue :fn_001.
:fn_001 rml:logicalSource :source_001;
    rr:predicateObjectMap :pomexec_001.
:pomexec_001 rr:predicateMap :pmexec_001.
:pmexec_001 rr:constant fno:executes.
:pomexec_001 rr:objectMap :omexec_001.
:omexec_001 rr:constant "http://example.com/idlab/function/equal";
    rr:termType rr:IRI.
:fn_001 rr:predicateObjectMap :pom_003.
:pom_003 a rr:PredicateObjectMap;
    rr:predicateMap :pm_003.
:pm_003 a rr:PredicateMap;
    rr:constant grel:valueParameter.
:pom_003 rr:objectMap :om_003.
:om_003 a rr:ObjectMap;
    rml:reference "forme";
    rr:termType rr:Literal.
:fn_001 rr:predicateObjectMap :pom_004.
:pom_004 a rr:PredicateObjectMap;
    rr:predicateMap :pm_004.
:pm_004 a rr:PredicateMap;
    rr:constant grel:valueParameter2.
:pom_004 rr:objectMap :om_004.
:om_004 a rr:ObjectMap;
    rr:constant "2";
    rr:termType rr:Literal.
:fn_000 rr:predicateObjectMap :pom_005.
:pom_005 a rr:PredicateObjectMap;
    rr:predicateMap :pm_005.
:pm_005 a rr:PredicateMap;
    rr:constant idlab-fn:str.
:pom_005 rr:objectMap :om_005.
:om_005 a rr:ObjectMap;
    rr:template "http://mshb.huma-num.fr/prelib/personne/{personne_id}";
    rr:termType rr:IRI.
:pom_006 a rr:PredicateObjectMap.
:map_AppellationsRetenuesPersonnesMapping_000 rr:predicateObjectMap :pom_006.
:pm_006 a rr:PredicateMap.
:pom_006 rr:predicateMap :pm_006.
:pm_006 rr:constant <http://www.w3.org/2004/02/skos/core#prefLabel>.
:pom_006 rr:objectMap :om_006.
:om_006 a rr:ObjectMap;
    rml:reference "appellation";
    rr:termType rr:Literal;
    rml:languageMap :language_000.
:language_000 rml:reference "code_iso_639_3".
:rules_000 void:exampleResource :map_AppellationsRejetteesPersonnesMapping_000.
:map_AppellationsRejetteesPersonnesMapping_000 rml:logicalSource :source_001;
    a rr:TriplesMap;
    rdfs:label "AppellationsRejetteesPersonnesMapping".
:s_002 a rr:SubjectMap.
:map_AppellationsRejetteesPersonnesMapping_000 rr:subjectMap :s_002.
:s_002 a fnml:FunctionTermMap;
    rr:termType rr:IRI;
    fnml:functionValue :fn_002.
:fn_002 rml:logicalSource :source_001;
    rr:predicateObjectMap :pomexec_002.
:pomexec_002 rr:predicateMap :pmexec_002.
:pmexec_002 rr:constant fno:executes.
:pomexec_002 rr:objectMap :omexec_002.
:omexec_002 rr:constant "http://example.com/idlab/function/trueCondition";
    rr:termType rr:IRI.
:fn_002 rr:predicateObjectMap :pom_007.
:pom_007 a rr:PredicateObjectMap;
    rr:predicateMap :pm_007.
:pm_007 a rr:PredicateMap;
    rr:constant idlab-fn:strBoolean.
:pom_007 rr:objectMap :om_007.
:om_007 a rr:ObjectMap, fnml:FunctionTermMap;
    fnml:functionValue :fn_003.
:fn_003 rml:logicalSource :source_001;
    rr:predicateObjectMap :pomexec_003.
:pomexec_003 rr:predicateMap :pmexec_003.
:pmexec_003 rr:constant fno:executes.
:pomexec_003 rr:objectMap :omexec_003.
:omexec_003 rr:constant "http://example.com/idlab/function/equal";
    rr:termType rr:IRI.
:fn_003 rr:predicateObjectMap :pom_008.
:pom_008 a rr:PredicateObjectMap;
    rr:predicateMap :pm_008.
:pm_008 a rr:PredicateMap;
    rr:constant grel:valueParameter.
:pom_008 rr:objectMap :om_008.
:om_008 a rr:ObjectMap;
    rml:reference "forme";
    rr:termType rr:Literal.
:fn_003 rr:predicateObjectMap :pom_009.
:pom_009 a rr:PredicateObjectMap;
    rr:predicateMap :pm_009.
:pm_009 a rr:PredicateMap;
    rr:constant grel:valueParameter2.
:pom_009 rr:objectMap :om_009.
:om_009 a rr:ObjectMap;
    rr:constant "1";
    rr:termType rr:Literal.
:fn_002 rr:predicateObjectMap :pom_010.
:pom_010 a rr:PredicateObjectMap;
    rr:predicateMap :pm_010.
:pm_010 a rr:PredicateMap;
    rr:constant idlab-fn:str.
:pom_010 rr:objectMap :om_010.
:om_010 a rr:ObjectMap;
    rr:template "http://mshb.huma-num.fr/prelib/personne/{personne_id}";
    rr:termType rr:IRI.
:pom_011 a rr:PredicateObjectMap.
:map_AppellationsRejetteesPersonnesMapping_000 rr:predicateObjectMap :pom_011.
:pm_011 a rr:PredicateMap.
:pom_011 rr:predicateMap :pm_011.
:pm_011 rr:constant <http://www.w3.org/2004/02/skos/core#altLabel>.
:pom_011 rr:objectMap :om_011.
:om_011 a rr:ObjectMap;
    rml:reference "appellation";
    rr:termType rr:Literal;
    rml:languageMap :language_001.
:language_001 rml:reference "code_iso_639_3".
:rules_000 void:exampleResource :map_CollectifsMapping_000.
:map_CollectifsMapping_000 rml:logicalSource :source_002;
    a rr:TriplesMap;
    rdfs:label "CollectifsMapping".
:s_003 a rr:SubjectMap.
:map_CollectifsMapping_000 rr:subjectMap :s_003.
:s_003 rr:template "http://mshb.huma-num.fr/prelib/collectif/{id}".
:pom_012 a rr:PredicateObjectMap.
:map_CollectifsMapping_000 rr:predicateObjectMap :pom_012.
:pm_012 a rr:PredicateMap.
:pom_012 rr:predicateMap :pm_012.
:pm_012 rr:constant rdf:type.
:pom_012 rr:objectMap :om_012.
:om_012 a rr:ObjectMap;
    rr:constant "http://www.cidoc-crm.org/cidoc-crm/E74_Group";
    rr:termType rr:IRI.
:pom_013 a rr:PredicateObjectMap.
:map_CollectifsMapping_000 rr:predicateObjectMap :pom_013.
:pm_013 a rr:PredicateMap.
:pom_013 rr:predicateMap :pm_013.
:pm_013 rr:constant rdfs:label.
:pom_013 rr:objectMap :om_013.
:om_013 a rr:ObjectMap;
    rml:reference "nom";
    rr:termType rr:Literal.
:rules_000 void:exampleResource :map_OccupationMapping_000.
:map_OccupationMapping_000 rml:logicalSource :source_006;
    a rr:TriplesMap;
    rdfs:label "OccupationMapping".
:s_004 a rr:SubjectMap.
:map_OccupationMapping_000 rr:subjectMap :s_004.
:s_004 rr:template "http://mshb.huma-num.fr/prelib/occupation/{id}".
:pom_014 a rr:PredicateObjectMap.
:map_OccupationMapping_000 rr:predicateObjectMap :pom_014.
:pm_014 a rr:PredicateMap.
:pom_014 rr:predicateMap :pm_014.
:pm_014 rr:constant rdf:type.
:pom_014 rr:objectMap :om_014.
:om_014 a rr:ObjectMap;
    rr:constant "https://ontome.net/ns/social-life-specific/C8";
    rr:termType rr:IRI.
:pom_015 a rr:PredicateObjectMap.
:map_OccupationMapping_000 rr:predicateObjectMap :pom_015.
:pm_015 a rr:PredicateMap.
:pom_015 rr:predicateMap :pm_015.
:pm_015 rr:constant sdh-so:P7_on_behalf_of.
:pom_015 rr:objectMap :om_015.
:om_015 a rr:ObjectMap;
    rr:template "http://mshb.huma-num.fr/prelib/personne/{personne_id}";
    rr:termType rr:IRI.
:rules_000 void:exampleResource :map_OeuvresMapping_000.
:map_OeuvresMapping_000 rml:logicalSource :source_003;
    a rr:TriplesMap;
    rdfs:label "OeuvresMapping".
:s_005 a rr:SubjectMap.
:map_OeuvresMapping_000 rr:subjectMap :s_005.
:s_005 rr:template "http://mshb.huma-num.fr/prelib/oeuvre/{id}".
:pom_016 a rr:PredicateObjectMap.
:map_OeuvresMapping_000 rr:predicateObjectMap :pom_016.
:pm_016 a rr:PredicateMap.
:pom_016 rr:predicateMap :pm_016.
:pm_016 rr:constant rdf:type.
:pom_016 rr:objectMap :om_016.
:om_016 a rr:ObjectMap;
    rr:constant "http://iflastandards.info/ns/fr/frbr/frbroo/F2";
    rr:termType rr:IRI.
:pom_017 a rr:PredicateObjectMap.
:map_OeuvresMapping_000 rr:predicateObjectMap :pom_017.
:pm_017 a rr:PredicateMap.
:pom_017 rr:predicateMap :pm_017.
:pm_017 rr:constant rdf:type.
:pom_017 rr:objectMap :om_017.
:om_017 a rr:ObjectMap;
    rr:constant "http://www.cidoc-crm.org/cidoc-crm/E33_Linguistic_Object";
    rr:termType rr:IRI.
:pom_018 a rr:PredicateObjectMap.
:map_OeuvresMapping_000 rr:predicateObjectMap :pom_018.
:pm_018 a rr:PredicateMap.
:pom_018 rr:predicateMap :pm_018.
:pm_018 rr:constant rdfs:label.
:pom_018 rr:objectMap :om_018.
:om_018 a rr:ObjectMap;
    rml:reference "titre";
    rr:termType rr:Literal.
:rules_000 void:exampleResource :map_OeuvresLanguesMapping_000.
:map_OeuvresLanguesMapping_000 rml:logicalSource :source_004;
    a rr:TriplesMap;
    rdfs:label "OeuvresLanguesMapping".
:s_006 a rr:SubjectMap.
:map_OeuvresLanguesMapping_000 rr:subjectMap :s_006.
:s_006 rr:template "http://mshb.huma-num.fr/prelib/oeuvre/{oeuvre_id}".
:pom_019 a rr:PredicateObjectMap.
:map_OeuvresLanguesMapping_000 rr:predicateObjectMap :pom_019.
:pm_019 a rr:PredicateMap.
:pom_019 rr:predicateMap :pm_019.
:pm_019 rr:constant crm:P72_has_language.
:pom_019 rr:objectMap :om_019.
:om_019 a rr:ObjectMap;
    rr:template "http://lexvo.org/id/iso639-3/{code_iso_639_3}";
    rr:termType rr:IRI.
:rules_000 void:exampleResource :map_AiresGeographiquesMapping_000.
:map_AiresGeographiquesMapping_000 rml:logicalSource :source_000;
    a rr:TriplesMap;
    rdfs:label "AiresGeographiquesMapping".
:s_007 a rr:SubjectMap.
:map_AiresGeographiquesMapping_000 rr:subjectMap :s_007.
:s_007 rr:template "http://mshb.huma-num.fr/prelib/airegeographique/{id}".
:pom_020 a rr:PredicateObjectMap.
:map_AiresGeographiquesMapping_000 rr:predicateObjectMap :pom_020.
:pm_020 a rr:PredicateMap.
:pom_020 rr:predicateMap :pm_020.
:pm_020 rr:constant rdf:type.
:pom_020 rr:objectMap :om_020.
:om_020 a rr:ObjectMap;
    rr:constant "https://ontome.net/ns/sdhss/C13_Geographical_Place";
    rr:termType rr:IRI.
:pom_021 a rr:PredicateObjectMap.
:map_AiresGeographiquesMapping_000 rr:predicateObjectMap :pom_021.
:pm_021 a rr:PredicateMap.
:pom_021 rr:predicateMap :pm_021.
:pm_021 rr:constant rdfs:label.
:pom_021 rr:objectMap :om_021.
:om_021 a rr:ObjectMap;
    rml:reference "nom";
    rr:termType rr:Literal.
:pom_022 a rr:PredicateObjectMap.
:map_AiresGeographiquesMapping_000 rr:predicateObjectMap :pom_022.
:pm_022 a rr:PredicateMap.
:pom_022 rr:predicateMap :pm_022.
:pm_022 rr:constant <http://www.w3.org/2002/07/owl#sameAs>.
:pom_022 rr:objectMap :om_022.
:om_022 a rr:ObjectMap;
    rr:template "http://www.wikidata.org/entity/{wikidata}";
    rr:termType rr:IRI.
SvenLieber commented 2 years ago

Hi,

sorry for my late answer.

Yes, this is right! The variables part I use is custom.

You may have to use the $(_...) variables directly in the mapping. I might be wrong, but it could even be that these variables are only read within the subject or predicate-object parts of mappings. If this is true, I suggest to open an issue in the repository of the yarrrml-parser to request the feature that external variables can also be used, for example, in the sources block.