Skip to content

Commit c45e89b

Browse files
Fix issues with example SPARQL queries
1 parent 0a96ef2 commit c45e89b

2 files changed

Lines changed: 27 additions & 29 deletions

File tree

tensile_test_data/S355_SPARQL_query.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@
137137
"outputs": [],
138138
"source": [
139139
"# Definition of links to ontologies, files, etc. to be loaded in the local triple store\n",
140-
"link_ontology_1 = \"https://w3id.org/pmd/co/3.0.0\" # PMD Core Ontology (PMDco) as basis for tensile test ontology\n",
140+
"link_ontology_1 = \"https://w3id.org/pmd/co/3.0.0\" # PMD Core Ontology (PMDco) in version 3.0.0 as basis for tensile test ontology\n",
141141
"link_ontology_2 = \"https://w3id.org/pmd/tto/\" # Tensile Test Ontology (TTO)\n",
142-
"link_data = \"https://raw.githubusercontent.com/materialdigital/tensile-test-ontology/refs/heads/main/tensile_test_data/S355_data_tto.rdf\" # Example data on S355 steel\n",
142+
"link_data = \"https://raw.githubusercontent.com/materialdigital/tensile-test-ontology/refs/heads/main/tensile_test_data/S355_data_tto_pmdco3.rdf\" # Example data on S355 steel\n",
143143
"\n",
144144
"# Loading ontologies and data files (A-Box) in the local triple store\n",
145145
"triple_store = load_ontologies_to_world(link_ontology_1, link_ontology_2)\n",
Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
1-
PREFIX pmdco: <https://w3id.org/pmd/co/>PREFIX pmdco: <https://w30136 ?Rp02_q .
1+
PREFIX pmdco: <https://w3id.org/pmd/co/>
2+
PREFIX tto: <https://w3id.org/pmd/tto/>
3+
PREFIX obo: <http://purl.obolibrary.org/obo/>
4+
5+
SELECT ?processId
6+
(SAMPLE(?Rp02) AS ?Rp02) (SAMPLE(?Rp02_unit) AS ?Rp02_unit)
7+
(SAMPLE(?Rm) AS ?Rm) (SAMPLE(?Rm_unit) AS ?Rm_unit)
8+
(SAMPLE(?E) AS ?E) (SAMPLE(?E_unit) AS ?E_unit)
9+
WHERE {
10+
# --- Parent tensile testing process ---
11+
?process a pmdco:PMD_0000974 .
12+
13+
# --- Process identifier (string) via Identifier pattern ---
14+
?pid a pmdco:PMD_0000017 ;
15+
obo:IAO_0000219 ?process ;
16+
pmdco:PMD_0060000 ?pid_vs .
17+
?pid_vs pmdco:PMD_0000006 ?processId .
18+
19+
# --- Rp0.2 (proof strength plastic extension rp02) ---
20+
OPTIONAL {
21+
?process obo:OBI_0000299 ?Rp02_smd .
22+
?Rp02_smd a pmdco:PMD_0000023 ;
23+
pmdco:PMD_0060000 ?Rp02_svs ;
24+
obo:IAO_0000136 ?Rp02_q .
225
?Rp02_q a tto:TTO_0000047 .
326
?Rp02_svs pmdco:PMD_0000006 ?Rp02 .
427
OPTIONAL { ?Rp02_svs pmdco:PMD_0000020 ?Rp02_unit }
528
}
629

730
# --- Rm (tensile strength) ---
8-
# class: tto:TTO_0000053 (tensile strength) [2](https://bambund-my.sharepoint.com/personal/markus_schilling_bam_de/Documents/Microsoft%20Copilot-Chatdateien/S355_SPARQL_query.ipynb.txt)
931
OPTIONAL {
1032
?process obo:OBI_0000299 ?Rm_smd .
1133
?Rm_smd a pmdco:PMD_0000023 ;
@@ -17,7 +39,6 @@ PREFIX pmdco: <https://w3id.org/pmd/co/>PREFIX pmdco: <https://w30136 ?Rp02_q .
1739
}
1840

1941
# --- E (elastic modulus) ---
20-
# class: pmdco:PMD_0000618 (elastic modulus) [1](https://bambund-my.sharepoint.com/personal/markus_schilling_bam_de/Documents/Microsoft%20Copilot-Chatdateien/S355_data_tto_pmdco3.ttl.txt)[2](https://bambund-my.sharepoint.com/personal/markus_schilling_bam_de/Documents/Microsoft%20Copilot-Chatdateien/S355_SPARQL_query.ipynb.txt)
2142
OPTIONAL {
2243
?process obo:OBI_0000299 ?E_smd .
2344
?E_smd a pmdco:PMD_0000023 ;
@@ -29,27 +50,4 @@ PREFIX pmdco: <https://w3id.org/pmd/co/>PREFIX pmdco: <https://w30136 ?Rp02_q .
2950
}
3051
}
3152
GROUP BY ?processId
32-
ORDER BY ?processId
33-
PREFIX tto: <https://w3id.org/pmd/tto/>
34-
PREFIX obo: <http://purl.obolibrary.org/obo/>
35-
36-
SELECT ?processId
37-
(SAMPLE(?Rp02) AS ?Rp02) (SAMPLE(?Rp02_unit) AS ?Rp02_unit)
38-
(SAMPLE(?Rm) AS ?Rm) (SAMPLE(?Rm_unit) AS ?Rm_unit)
39-
(SAMPLE(?E) AS ?E) (SAMPLE(?E_unit) AS ?E_unit)
40-
WHERE {
41-
# --- Parent tensile testing process ---
42-
?process a pmdco:PMD_0000974 .
43-
44-
# --- Process identifier (string) via Identifier pattern ---
45-
?pid a pmdco:PMD_0000017 ;
46-
obo:IAO_0000219 ?process ;
47-
pmdco:PMD_0060000 ?pid_vs .
48-
?pid_vs pmdco:PMD_0000006 ?processId .
49-
50-
# --- Rp0.2 (stress at 0.2% plastic extension) ---
51-
# class: tto:TTO_0000047 (proof strength plastic extension rp02) [2](https://bambund-my.sharepoint.com/personal/markus_schilling_bam_de/Documents/Microsoft%20Copilot-Chatdateien/S355_SPARQL_query.ipynb.txt)
52-
OPTIONAL {
53-
?process obo:OBI_0000299 ?Rp02_smd .
54-
?Rp02_smd a pmdco:PMD_0000023 ;
55-
pmdco:PMD_0060000 ?Rp02_svs ;
53+
ORDER BY ?processId

0 commit comments

Comments
 (0)