-
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.
add some examples on indexing preston provenance logs; related to bio…
- Loading branch information
Jorrit Poelen
committed
Dec 16, 2023
1 parent
44bb276
commit e431046
Showing
6 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
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,13 @@ | ||
SELECT ?archiveUrl ?seenAt ?contentId | ||
WHERE { | ||
graph ?g1 { | ||
<urn:uuid:4fa7b334-ce0d-4e88-aaae-2e0c138d049e> <http://www.w3.org/ns/prov#hadMember> ?archiveUrl . | ||
?archiveUrl <http://purl.org/dc/elements/1.1/format> "application/dwca" . | ||
} | ||
graph ?activity { | ||
?activity <http://www.w3.org/ns/prov#used> ?archiveUrl . | ||
?activity <http://www.w3.org/ns/prov#generatedAtTime> ?seenAt . | ||
?contentId <http://www.w3.org/ns/prov#qualifiedGeneration> ?activity . | ||
} | ||
} limit 10 | ||
|
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,20 @@ | ||
2023-12-15 | ||
Jorrit Poelen | ||
|
||
This directory contains examples on how query preston provenance logs using SPARQL: | ||
|
||
Step 1. | ||
Stream preston provenance logs into a triple-store. | ||
|
||
Step 2. | ||
Write a query in sparql. | ||
|
||
Step 3. | ||
Execute query. | ||
|
||
Step 4. | ||
Inspect results. | ||
|
||
|
||
See https://github.com/bio-guoda/preston/issues/199#issuecomment-1858618208 for context and 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,8 @@ | ||
|
||
SELECT ?s ?p ?o | ||
WHERE { | ||
GRAPH ?g { | ||
?s <http://purl.org/pav/hasVersion> ?o . | ||
} | ||
} | ||
|
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,32 @@ | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | ||
|
||
SELECT ?contentId ?seenAt ?archiveUrl WHERE | ||
{ | ||
{ | ||
SELECT ?contentId ?seenAt ?archiveUrl | ||
WHERE { | ||
graph ?g1 { | ||
<urn:uuid:4fa7b334-ce0d-4e88-aaae-2e0c138d049e> <http://www.w3.org/ns/prov#hadMember> ?archiveUrl . | ||
?archiveUrl <http://purl.org/dc/elements/1.1/format> "application/dwca" . | ||
} | ||
graph ?activity { | ||
?activity <http://www.w3.org/ns/prov#used> ?archiveUrl . | ||
?activity <http://www.w3.org/ns/prov#generatedAtTime> ?seenAt . | ||
?contentId <http://www.w3.org/ns/prov#qualifiedGeneration> ?activity . | ||
} | ||
} | ||
} | ||
UNION | ||
{ | ||
SELECT ?contentId ?seenAt ?archiveUrl | ||
WHERE { | ||
<urn:uuid:4fa7b334-ce0d-4e88-aaae-2e0c138d049e> <http://www.w3.org/ns/prov#hadMember> ?archiveUrl . | ||
?archiveUrl <http://purl.org/dc/elements/1.1/format> "application/dwca" . | ||
?activity <http://www.w3.org/ns/prov#used> ?archiveUrl . | ||
?activity <http://www.w3.org/ns/prov#generatedAtTime> ?seenAt . | ||
?contentId <http://www.w3.org/ns/prov#qualifiedGeneration> ?activity . | ||
} | ||
} | ||
} ORDER BY ?seenAt | ||
|
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,15 @@ | ||
#!/bin/bash | ||
# | ||
# index provenance graph associated with an anchor | ||
# into oxigraph | ||
# | ||
|
||
|
||
preston ls\ | ||
--anchor hash://sha256/5b7fa37bf8b64e7c935c4ff3389e36f8dd162f0705410dd719fd089e1ea253cd\ | ||
--remote https://linker.bio\ | ||
| sed -E 's/(<)([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})([^ ]*)(>)/<urn:uuid:\2>/g'\ | ||
| pv -l\ | ||
| ./oxigraph_server_v0.3.22_x86_64_linux_gnu load --lenient --format nq --location preston-gib | ||
|
||
|
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,9 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
|
||
SELECT ?o | ||
WHERE { | ||
<http://collections.mnhn.fr/ipt/archive.do?r=mnhn-ar> <http://purl.org/pav/hasVersion> ?o . | ||
} limit 10 | ||
|
||
|