Skip to content

Commit

Permalink
Extract class of object if existent
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminaaron committed May 8, 2024
1 parent 204a2f1 commit af7d5b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@foerderfunke/matching-engine",
"version": "0.4.4",
"version": "0.4.5",
"description": "Checks eligibilities by validating a user profile against requirement profiles",
"author": "@foerderfunke",
"license": "MIT",
Expand Down
8 changes: 7 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,24 @@ export async function extractDatafieldsMetadata(datafieldsStr) {
let query = `
PREFIX ff: <https://foerderfunke.org/default#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
SELECT * WHERE {
?dfUri a ff:DataField .
OPTIONAL { ?dfUri rdfs:label ?label } .
OPTIONAL { ?dfUri rdfs:comment ?comment } .
OPTIONAL {
?property sh:path ?dfUri ;
sh:class ?class .
}
}`
let metadata = {}
let rows = await runSparqlSelectQueryOnStore(query, store)
for (let row of rows) {
metadata[row.dfUri] = {
uri: row.dfUri,
label: row.label ?? "",
comment: row.comment ?? ""
comment: row.comment ?? "",
objectHasClass: row.class ?? ""
}
}
return metadata
Expand Down

0 comments on commit af7d5b0

Please sign in to comment.