This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a4519ea
Showing
24 changed files
with
975 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>FörderFunke</title> | ||
</head> | ||
<body> | ||
<div id="output"></div> | ||
<script src="./bundle.js"></script> | ||
<script> | ||
let userProfile = ` | ||
@prefix ff: <https://foerderfunke.org/default#> . | ||
ff:mainPerson a ff:Citizen ; | ||
ff:hasAge 24 . | ||
` | ||
|
||
let shacl = ` | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix ff: <https://foerderfunke.org/default#> . | ||
ff:MainPersonShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:hasAge ; | ||
sh:maxExclusive 18 ; | ||
] . | ||
` | ||
|
||
MatchingEngine.validateOne(userProfile, "", "", shacl).then((report) => { | ||
console.log(report) | ||
document.getElementById("output").innerHTML = JSON.stringify(report, null, 2) | ||
}) | ||
|
||
function fetchTurtleDev() { | ||
fetch("requirement-profiles/meta.ttl") | ||
.then(response => response.text()) | ||
.then(data => { | ||
console.log("data", data) | ||
}) | ||
.catch(err => console.error(err)); | ||
} | ||
fetchTurtleDev() | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 FörderFunke | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# requirement-profiles | ||
Requirement profiles, details about datafields and materialization queries. | ||
|
||
Used in the [foerderfunke-app](https://github.com/Citizen-Knowledge-Graph/foerderfunke-app) and for developing the [matching-engine](https://github.com/Citizen-Knowledge-Graph/matching-engine). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix fim: <https://schema.fim.fitko.net/fields/baukasten/> . | ||
@prefix ff: <https://foerderfunke.org/default#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix foaf: <http://xmlns.com/foaf/0.1/> . | ||
|
||
ff:hasFirstNames a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F00000154 ; | ||
ff:hasFimVersion "1.3" ; | ||
ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F00000154/1.3" ; | ||
rdfs:label "Vornamen: Vorname + Mittelnamen" ; | ||
rdfs:comment "Plural zu Vorname" ; | ||
ff:similarDatafield foaf:firstName ; | ||
ff:hasShaclShape ff:FirstNamesShape . | ||
ff:FirstNamesShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:hasFirstNames ; | ||
sh:datatype xsd:string ; | ||
] . | ||
|
||
ff:hasFamilyName a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F00000013 ; | ||
ff:hasFimVersion "1.5" ; | ||
ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F00000013/1.5" ; | ||
rdfs:label "Familienname" ; | ||
rdfs:comment "Familienname einer natürlichen Person bestehend aus Nachname, Zuname bzw. Familienname." ; | ||
ff:similarDatafield foaf:lastName ; | ||
ff:hasShaclShape ff:FamilyNameShape . | ||
ff:FamilyNameShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:hasFamilyName ; | ||
sh:datatype xsd:string ; | ||
] . | ||
|
||
ff:hasBirthday a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F03008235 ; | ||
ff:hasFimVersion "2.0" ; | ||
ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F03008235/2.0" ; | ||
rdfs:label "Geburtsdatum" ; | ||
rdfs:comment "Dieses Feld beinhaltet das Geburtsdatum, also Tag, Monat und Jahr der Vollendung der Geburt." ; | ||
ff:similarDatafield foaf:birthday ; | ||
ff:hasShaclShape ff:BirthdayShape . | ||
ff:BirthdayShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:hasBirthday ; | ||
sh:datatype xsd:date ; | ||
] . | ||
|
||
ff:hasGender a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F60000332 ; | ||
ff:hasFimVersion "1.3" ; | ||
ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F60000332/1.3" ; | ||
rdfs:label "Geschlecht" ; | ||
rdfs:comment "Beschreibt das Geschlecht einer Person. Folgende Angaben sind möglich: divers, männlich, weiblich, keine Angabe" ; | ||
ff:hasShaclShape ff:GenderShape . | ||
ff:GenderShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:hasGender ; | ||
sh:in ("weiblich" "männlich" "divers" "keine Angabe") ; | ||
rdfs:seeAlso <https://schema.fim.fitko.net/fields/baukasten/F60000332/1.3> | ||
] . | ||
|
||
ff:hasBirthPlace a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F00000067 ; | ||
ff:hasFimVersion "1.3" ; | ||
ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F00000067/1.3" ; | ||
rdfs:label "Geburtsort" ; | ||
rdfs:comment "Der Ort der Geburt einer natürlichen Person." ; | ||
ff:hasShaclShape ff:BirthPlaceShape . | ||
ff:BirthPlaceShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:hasBirthPlace ; | ||
sh:datatype xsd:string ; | ||
] . | ||
|
||
ff:hasResidence a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F03010085 ; | ||
ff:hasFimVersion "1.0" ; | ||
ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F03010085/1.0" ; | ||
rdfs:label "Wohnort" ; | ||
rdfs:comment "Enthält den Namen eines Ortes (Gemeinde, Ortschaft oder Stadt)." ; | ||
ff:hasShaclShape ff:ResidenceShape . | ||
ff:ResidenceShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:hasResidence ; | ||
sh:datatype xsd:string ; | ||
] . | ||
|
||
ff:hasMaritalStatus a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F00000559 ; | ||
ff:hasFimVersion "1.3" ; | ||
ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F00000559/1.3" ; | ||
rdfs:label "Familienstand" ; | ||
ff:hasShaclShape ff:MaritalStatusShape . | ||
ff:MaritalStatusShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:hasMaritalStatus ; | ||
sh:in ("LD" "VH" "VW" "GS" "EA" "LP" "LV" "LA" "LE" "NB") ; | ||
ff:shInAbbrevationsStandFor ("ledig" "verheiratet" "verwitwet" "geschieden" "Ehe aufgehoben" "in eingetragener Lebenspartnerschaft" "durch Tod aufgelöste Lebenspartnerschaft" "aufgehobene Lebenspartnerschaft" "durch Todeserklärung aufgelöste Lebenspartnerschaft" "nicht bekannt") ; | ||
rdfs:seeAlso <https://www.xrepository.de/details/urn:de:dsmeld:schluesseltabelle:familienstand> | ||
] . | ||
|
||
ff:eligibleForSocialSupport a ff:DataField ; | ||
rdfs:label "Sozialbedürftig" ; | ||
rdfs:comment "This is a shortcut for demo purposes" ; | ||
ff:hasShaclShape ff:EligibleForSocialSupportShape . | ||
ff:EligibleForSocialSupportShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:eligibleForSocialSupport ; | ||
sh:datatype xsd:boolean ; | ||
] . | ||
|
||
ff:worksAsFreelancer a ff:DataField ; | ||
rdfs:label "Selbstständige Tätigkeiten" ; | ||
ff:hasShaclShape ff:WorksAsFreelancerShape . | ||
ff:WorksAsFreelancerShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:worksAsFreelancer ; | ||
sh:datatype xsd:boolean ; | ||
] . | ||
|
||
# ------------------------------------------------------ | ||
|
||
ff:hasAge a ff:DataField ; | ||
rdfs:label "Alter" ; | ||
ff:similarDatafield foaf:age ; | ||
ff:hasShaclShape ff:AgeShape . | ||
ff:AgeShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:hasAge ; | ||
sh:datatype xsd:integer ; | ||
sh:minInclusive 0 ; | ||
] . | ||
|
||
ff:paysRentCold a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F00000240 ; | ||
ff:hasFimVersion "1.5" ; | ||
rdfs:label "Höhe der Miete" ; | ||
ff:hasShaclShape ff:paysRentColdShape . | ||
ff:paysRentColdShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
sh:property [ | ||
sh:path ff:paysRentCold ; | ||
sh:maxCount 1 ; | ||
sh:minInclusive 0 ; | ||
] . | ||
|
||
ff:hasLivingArea a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F00003175 ; | ||
ff:hasFimVersion "1.0" ; | ||
rdfs:label "Wohnfläche in m²" . | ||
|
||
ff:hasNumberOfChildren a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F05011522 ; | ||
ff:hasFimVersion "1.0" ; | ||
rdfs:label "Anzahl Kinder" ; | ||
rdfs:comment "Angabe der Anzahl der im Haushalt lebenden Kinder." . | ||
|
||
ff:hasIncomeBrutto a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F00000575 ; | ||
ff:hasFimVersion "1.1" ; | ||
rdfs:label "Höhe des Einkommens (Brutto)" . | ||
|
||
ff:hasIncomeNetto a ff:FimDataFieldProperty, ff:DataField ; | ||
ff:hasFimId fim:F00001158 ; | ||
ff:hasFimVersion "1.0" ; | ||
rdfs:label "Nettoeinkommen monatlich" . | ||
|
||
ff:receivesKindergeld a ff:FimLeistung, ff:DataField ; | ||
ff:hasFimId 576982 ; | ||
ff:hasLeiKaId 99041008000000 ; | ||
rdfs:label "Kindergeld" . | ||
|
||
ff:parentingSetup a ff:DataField ; | ||
rdfs:label "Erziehungsverantwortung" ; | ||
ff:canHaveValue [ | ||
ff:hasFimId fim:F00001072 ; | ||
ff:hasFimVersion "1.1" ; | ||
rdfs:label "Alleinerziehend" ; | ||
] , | ||
[ | ||
a ff:DataField ; | ||
rdfs:label "Elternpaar" ; | ||
] . | ||
|
||
ff:receivesWohngeld a ff:DataField ; | ||
rdfs:label "Wohngeld" . | ||
|
||
ff:hasChild a ff:DataField ; | ||
rdfs:label "Kind" . | ||
|
||
ff:hasEmploymentStatus a ff:DataField ; | ||
rdfs:label "Beschäftigungsverhältnis" ; | ||
ff:hasShaclShape ff:hasEmploymentStatusShape . | ||
|
||
ff:hasEmploymentStatusShape a sh:NodeShape ; | ||
sh:targetClass ff:Citizen ; | ||
ff:modelledAfter <https://www.xrepository.de/details/urn:xoev-de:xfamilie:codeliste:einkommensart> ; | ||
sh:property [ | ||
sh:path ff:hasEmploymentStatus ; | ||
sh:in ( "Angestellt" "Selbststaendig" "Ausbildung" "Arbeitslos" "Gefoerderte Ausbildung" ) ; | ||
] . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@prefix ff: <https://foerderfunke.org/default#> . | ||
@prefix schema: <http://schema.org/> . | ||
@prefix dcterms: <http://purl.org/dc/terms/> . | ||
|
||
ff:datafieldsFile a schema:DigitalDocument ; | ||
schema:identifier "datafields-file" ; | ||
dcterms:format "text/turtle" ; | ||
ff:relativePath "datafields.ttl" . | ||
|
||
ff:materializationFile a schema:DigitalDocument ; | ||
schema:identifier "materialization-file" ; | ||
dcterms:format "text/turtle" ; | ||
ff:relativePath "materialization.ttl" . | ||
|
||
ff:requirementProfilesFolder a schema:Collection ; | ||
schema:identifier "requirement-profiles-folder" ; | ||
ff:relativePath "shacl/" . | ||
|
||
ff:userProfileExamplesFolder a schema:Collection ; | ||
schema:identifier "user-profile-examples-folder" ; | ||
ff:relativePath "user-profile-examples/" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix ff: <https://foerderfunke.org/default#> . | ||
|
||
# MATERIALIZATION RULES | ||
|
||
ff:CalculateAgeFromBirthdate a ff:MaterializationRule, ff:SparqlRule ; | ||
rdfs:label "Calculate the age from the birthdate" ; | ||
ff:input ff:hasBirthday ; | ||
ff:output ff:hasAge ; | ||
ff:suggestPermanentMaterialization true ; | ||
ff:ifPermanentlyMaterializedAddPeriodicCheck "on-app-startup" ; | ||
ff:sparqlConstructQuery """ | ||
PREFIX ff: <https://foerderfunke.org/default#> | ||
CONSTRUCT { | ||
?person ff:hasAge ?age . | ||
} WHERE { | ||
?person ff:hasBirthday ?bday . | ||
BIND(YEAR(NOW()) - YEAR(?bday) - IF(MONTH(NOW()) < MONTH(?bday) || (MONTH(NOW()) = MONTH(?bday) && DAY(NOW()) < DAY(?bday)), 1, 0) AS ?age) . | ||
} | ||
""" . | ||
|
||
ff:DeriveStateFromCity a ff:MaterializationRule, ff:SparqlRule ; | ||
rdfs:label "Derive the federal state someone lives in based on their residence city" ; | ||
ff:input ff:hasResidence ; | ||
ff:output ff:residesInState ; | ||
ff:sparqlConstructQuery """ | ||
PREFIX ff: <https://foerderfunke.org/default#> | ||
CONSTRUCT { | ||
?person ff:residesInState ?state . | ||
} WHERE { | ||
?person ff:hasResidence ?city . | ||
ff:CityStateMap ff:mappedCityToState ?mapping . | ||
?mapping ff:city ?city ; | ||
ff:state ?state . | ||
} | ||
""" . | ||
|
||
# CONSTANTS | ||
|
||
ff:CityStateMap a ff:MapOfConstants ; | ||
rdfs:comment "Mapping of German cities to their respective federal states (Bundesland)" ; | ||
ff:mappedCityToState [ | ||
ff:city "Jena" ; | ||
ff:state "Thüringen" | ||
] ; | ||
ff:mappedCityToState [ | ||
ff:city "München" ; | ||
ff:state "Bayern" | ||
] ; | ||
ff:mappedCityToState [ | ||
ff:city "Berlin" ; | ||
ff:state "Berlin" | ||
] . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@prefix ff: <https://foerderfunke.org/default#> . | ||
@prefix cccev: <http://data.europa.eu/m8g/> . # Core Criterion and Core Evidence Vocabulary https://github.com/SEMICeu/CCCEV | ||
|
||
ff:RequirementProfile a cccev:Criterion . | ||
|
||
ff:EligibilityConstraint a cccev:Constraint . | ||
|
||
ff:DataField a cccev:Evidence . |
Oops, something went wrong.