Skip to content

Commit

Permalink
Merge pull request #1738 from microbiomedata/1735-referential-ineggri…
Browse files Browse the repository at this point in the history
…ty-checking-of-napa-squads-mongodb-via-sparql-in-fuseki

referential integrity checking of napa squads mongodb via sparql in fuseki
  • Loading branch information
turbomam authored Jan 30, 2024
2 parents 4e6f7b9 + 95b116f commit 5146980
Show file tree
Hide file tree
Showing 11 changed files with 434 additions and 115 deletions.
8 changes: 7 additions & 1 deletion assets/other_mixs_yaml_files/mixs_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ subsets:

notes:
- removed several MIxS terms/slots that were sharing slot uris; commented out Biosample assignments
- note that the NMDC submission schema in sheets_and_friends takes its MIxS terms from https://raw.githubusercontent.com/GenomicsStandardsConsortium/mixs/main/model/schema/mixs.yaml and then potentially modifies them. Ideally this file would contain MIxS terms, essentially ready-to-use
- note that the NMDC submission schema in sheets_and_friends takes its MIxS terms
from https://raw.githubusercontent.com/GenomicsStandardsConsortium/mixs/main/model/schema/mixs.yaml
and then potentially modifies them. Ideally this file would contain MIxS terms, essentially ready-to-use
- multiple LinkML representations of MIxS are currently available and one will be blessed soon

prefixes:
nmdc: https://w3id.org/nmdc/
MIXS: https://w3id.org/mixs/
linkml: https://w3id.org/linkml/

imports:
- linkml:types

default_prefix: MIXS

Expand Down
33 changes: 33 additions & 0 deletions assets/sparql/objects-that-are-never-subjects.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT
distinct
?st ?p ?o
# ?p
WHERE {
graph <https://api-napa.microbiomedata.org> {
?s ?p ?o .
filter(isuri(?o))
minus {
?o ?op ?oo .
} minus {
?s <https://w3id.org/nmdc/award_dois> ?o .
} minus {
?s <https://w3id.org/nmdc/publication_dois> ?o .
} minus {
?s <https://w3id.org/nmdc/massive_study_identifiers> ?o .
}
optional {
?s a ?st
}
} minus {
graph <https://w3id.org/nmdc/nmdc> {
?o ?op ?oo .
}
} minus {
graph <https://w3id.org/nmdc/nmdc> {
?p rdfs:subPropertyOf* <https://w3id.org/nmdc/alternative_identifiers>
}
}
}
order by ?st ?p ?o
13 changes: 13 additions & 0 deletions assets/sparql/subjects-lacking-rdf-types.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT
distinct ?s
WHERE {
graph <https://api-napa.microbiomedata.org> {
?s ?p ?o .
minus {
?s a ?st .
}
}
}
order by ?s
23 changes: 23 additions & 0 deletions assets/sparql/undefined-non-procs-inputs.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Alicia and I wrote this together. It might ahve some good bits, but string filtering is usually a bad practice
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT
distinct ?s ?st ?o
WHERE {
graph <https://api-napa.microbiomedata.org> {
?s <https://w3id.org/nmdc/has_input> ?o .
filter(!(strstarts(str(?o),"https://w3id.org/nmdc/procsm")))
optional {
?s a ?st
}
filter(isuri(?o))
minus {
?o ?op ?oo .
}
}
minus {
graph <https://w3id.org/nmdc/nmdc> {
?o ?op ?oo .
}
}
}
5 changes: 5 additions & 0 deletions assets/yq-for-mixs_subset_modified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,8 @@

# add "M horizon" to soil_horizon_enum
'.enums.soil_horizon_enum.permissible_values.["M horizon"] = {}'

# as of 2024-01-30:
# ValueError: Conflicting URIs (https://raw.githubusercontent.com/microbiomedata/nmdc-schema/main/src/schema/mixs.yaml, https://w3id.org/linkml/types) for item: date
make: *** [Makefile:102: gen-project] Error 1
'del(.types)'
103 changes: 60 additions & 43 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5146980

Please sign in to comment.