Skip to content

Commit

Permalink
adding mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
dachafra committed Oct 16, 2024
1 parent 8224b06 commit bb40f90
Show file tree
Hide file tree
Showing 3 changed files with 204 additions and 5 deletions.
5 changes: 3 additions & 2 deletions ecai2024/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<body id="page-top">
<script>
// Set the date we're counting down to
var countDownDate = new Date("October 19, 2024 09:00:00").getTime();
var countDownDate = new Date("October 19, 2024 14:00:00").getTime();

// Update the count down every 1 second
var x = setInterval(function() {
Expand Down Expand Up @@ -218,8 +218,9 @@ <h3 class="mb-0">Anastasia Dimou</h3> <h4>KU Leuven</h4> <h5>anastasia.dimou (at
<section class="resume-section p-3 p-lg-5 d-flex flex-column" id="materials">
<div class="my-auto">
<h2 class="mb-5"><span class="text-primary">Materials</span></h2>
<div class="subheading mb-3"> All the necessary materials for the tutorial are available at:
<div class="subheading mb-3"> All the necessary materials for the tutorial are available in this <a href="https://github.com/kg-construct/tutorials/tree/main/ecai2024/resources">GitHub</a>
</div>
<div class="subheading mb-3"> <a href="">Slides (soon)</a>
<div class="subheading mb-3">Technologies</div>


Expand Down
182 changes: 182 additions & 0 deletions ecai2024/resources/rml_mapping.rml.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix ontology: <http://data.sfgov.org/ontology/>.
@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix ex: <http://www.ex.org/>.
@prefix rml: <http://w3id.org/rml/>.
@prefix ql: <http://semweb.mmlab.be/ns/ql#>.
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#>.
@prefix schema: <http://schema.org/>.
@prefix formats: <http://www.w3.org/ns/formats/>.
@prefix comp: <http://semweb.mmlab.be/ns/rml-compression#>.
@prefix void: <http://rdfs.org/ns/void#>.
@prefix fnml: <http://semweb.mmlab.be/ns/fnml#>.
@base <http://example.com/ns#>.


<Aircraft_0> a rr:TriplesMap;

rml:logicalSource [
a rml:LogicalSource;
rml:source "https://raw.githubusercontent.com/kg-construct/tutorials/refs/heads/main/ecai2024/resources/data/sfo-aircraft-tail-numbers-and-models.csv";
rml:referenceFormulation ql:CSV
];
rr:subjectMap [
a rr:SubjectMap;
rr:template "http://www.ex.org/Aircraft/{aircraft_id}";
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant rdf:type;
];
rr:objectMap [
a rr:ObjectMap;
rr:constant ex:Aircraft;
];
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant ex:hasID;
];
rr:objectMap [
a rr:ObjectMap;
rml:reference "aircraft_id";
rr:datatype xsd:string
];
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant ex:hasCreationDate;
];
rr:objectMap [
a rr:ObjectMap;
rml:reference "creation_date";
rr:datatype xsd:dateTime
];
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant ex:hasModificationDate;
];
rr:objectMap [
a rr:ObjectMap;
rml:reference "modification_date";
rr:datatype xsd:dateTime
];
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant ex:hasStatus;
];
rr:objectMap [
a rr:ObjectMap;
rml:reference "status";
rr:datatype xsd:string
];
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant ex:hasTailNumber;
];
rr:objectMap [
a rr:ObjectMap;
rml:reference "tail_number";
rr:datatype xsd:string
];
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant ex:hasAircraftModel;
];
rr:objectMap [
a rr:RefObjectMap;
rr:parentTriplesMap <AircraftModel_0>;
rr:joinCondition [
rr:child "aircraft_id";
rr:parent "aircraft_id";
];
];
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant ex:hasOwningAirline;
];
rr:objectMap [
a rr:RefObjectMap;
rr:parentTriplesMap <Airline_0>;
rr:joinCondition [
rr:child "aircraft_id";
rr:parent "aircraft_id";
];
];
].


<Airline_0> a rr:TriplesMap;

rml:logicalSource [
a rml:LogicalSource;
rml:source "https://raw.githubusercontent.com/kg-construct/tutorials/refs/heads/main/ecai2024/resources/data/sfo-aircraft-tail-numbers-and-models.csv";
rml:referenceFormulation ql:CSV
];
rr:subjectMap [
a rr:SubjectMap;
rr:template "http://www.example.org/Airline/{airline}";
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant rdf:type;
];
rr:objectMap [
a rr:ObjectMap;
rr:constant ex:Airline;
];
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant ex:owns;
];
rr:objectMap [
a rr:RefObjectMap;
rr:parentTriplesMap <Aircraft_0>;

]
].


<AircraftModel_0> a rr:TriplesMap;

rml:logicalSource [
a rml:LogicalSource;
rml:source "https://raw.githubusercontent.com/kg-construct/tutorials/refs/heads/main/ecai2024/resources/data/sfo-aircraft-tail-numbers-and-models.csv";
rml:referenceFormulation ql:CSV
];
rr:subjectMap [
a rr:SubjectMap;
rr:template "http://www.ex.org/AircraftModel/{aircraft_model}";
];
rr:predicateObjectMap [
rr:predicateMap [
a rr:PredicateMap;
rr:constant rdf:type;
];
rr:objectMap [
a rr:ObjectMap;
rr:constant ex:AircraftModel;
];
].


22 changes: 19 additions & 3 deletions ecai2024/resources/yarrrml_mapping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,36 @@ mappings:
po:
- [a, ex:Aircraft]
- [ex:hasID, $(aircraft_id), xsd:string]
- [ex:hasAircraftModel, ex:AircraftModel/$(aircraft_model)~iri]
- [ex:hasOwningAirline, ex:Airline/$(airline)~iri]
- [ex:hasCreationDate, $(creation_date), xsd:dateTime]
- [ex:hasModificationDate, $(modification_date), xsd:dateTime]
- [ex:hasStatus, $(status), xsd:string]
- [ex:hasTailNumber, $(tail_number), xsd:string]
- p: ex:hasAircraftModel
o:
- mapping: AircraftModel
condition:
function: equal
parameters:
- [str1, $(aircraft_id), s]
- [str2, $(aircraft_id), o]
- p: ex:hasOwningAirline
o:
- mapping: Airline
condition:
function: equal
parameters:
- [str1, $(aircraft_id), s]
- [str2, $(aircraft_id), o]

Airline:
sources:
- [data/sfo-aircraft-tail-numbers-and-models.csv~csv]
s: http://www.example.org/Airline/$(airline)
po:
- [a, ex:Airline]
- [ex:owns, ex:Aircraft/$(aircraft_id)~iri]
- p: ex:owns
o:
- mapping: Aircraft

AircraftModel:
sources:
Expand Down

0 comments on commit bb40f90

Please sign in to comment.