Skip to content

Commit

Permalink
Show triples count
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Sep 26, 2024
1 parent ba30429 commit 802751d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manual/img/data-flow.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ flowchart LR
Property_Graph["<b>Property_Graph</b><br/><i>status: prototype</i>"]
RDF["<b>RDF</b>"]
RDFConverter["<b>RDFConverter</b><br/><i>status: planned</i><br/><i>repo: ?</i>"]
Terminologies["<b>Terminologies</b>"]
Terminologies["<b>Terminologies</b><br/><i>repo: n4o-terminologies</i><br/><i>status: prototype</i>"]
TerminologyConverter["<b>TerminologyConverter</b><br/><i>status: planned</i><br/><i>repo: ?</i>"]
Triple_Store["<b>Triple_Store</b><br/><i>status: prototype</i>"]
sources["<b>sources</b><br/><i>repo: n4o-databases</i><br/><i>status: prototype</i>"]
Expand Down
9 changes: 9 additions & 0 deletions manual/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@ async function cypherQuery(query) {
return data
})
}

async function sparqlQuery(body) {
return fetch('https://graph.nfdi4objects.net/api/sparql', {method: "POST", body, headers: { "Content-Type": "application/sparql-query" }}).then(async response => {
const data = await response.json()
if (!response.ok) throw new Error(`${data.error}: ${data.message}`)
if (!Array.isArray(data)) throw new TypeError("Malformed API response")
return data
})
}
3 changes: 2 additions & 1 deletion manual/status.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ Folgende Übersicht wird live per [Cypher API](cypher.qmd) erstellt.
//| output: false
cypherNodesCount = await cypherQuery("MATCH () RETURN count(*) as count")
cypherEdgesCount = await cypherQuery("MATCH ()-[]->() RETURN count(*) as count")
sparqlTripleCount = await sparqlQuery("SELECT (COUNT(*) as ?count) { GRAPH ?graph { ?s ?p ?o } }")
```

## Triple Store

*noch nicht umgesetzt*
- Anzahl von Tripel: `{ojs} sparqlTriplesCount[0]?.count?.toLocaleString()`

## Datenquellen

Expand Down

0 comments on commit 802751d

Please sign in to comment.