Template:Workflow: Difference between revisions
From MaRDI portal
No edit summary |
EloiFerrer (talk | contribs) No edit summary Tag: Manual revert |
||
(56 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
== Model == | == Model == | ||
<div class="no-pagination no-filter"> | |||
{{#sparql: | {{#sparql: | ||
PREFIX mdb: <https://mardi4nfdi.de/mathmoddb#> | PREFIX mdb: <https://mardi4nfdi.de/mathmoddb#> | ||
SELECT ?Label ?Description ?Time | SELECT ?Label ?Description ?Time ?Space WHERE { | ||
wd:{{#invoke:Wd|label|raw|}} wdt:P557 ?item . | wd:{{#invoke:Wd|label|raw|}} wdt:P557 ?item . | ||
?item wdt:P31 wd:Q68663; | ?item wdt:P31 wd:Q68663; | ||
Line 24: | Line 25: | ||
SERVICE <https://sparql.mtsr2024.m1.mardi.ovh/mathalgodb/query> { | SERVICE <https://sparql.mtsr2024.m1.mardi.ovh/mathalgodb/query> { | ||
?url rdfs:comment ?Description; | ?url rdfs:comment ?Description; | ||
OPTIONAL {?url mdb:isTimeContinuous ?isTimeContinuous. | OPTIONAL {?url mdb:isTimeContinuous ?isTimeContinuous.} | ||
BIND( | |||
IF(BOUND(?isTimeContinuous), | |||
IF(?isTimeContinuous = true, "continuous", "discrete"), | |||
"independent") AS ?Time ) | |||
OPTIONAL {?url mdb:isSpaceContinuous ?isSpaceContinuous.} | |||
BIND( | |||
IF(BOUND(?isSpaceContinuous), | |||
IF(?isSpaceContinuous = true, "continuous", "discrete"), | |||
"independent") AS ?Space ) | |||
} | } | ||
} | } | ||
| chart=bordercloud.visualization.DataTable | |||
}} | |||
</div> | |||
=== Variables === | |||
{{#sparql: | |||
PREFIX mdb: <https://mardi4nfdi.de/mathmoddb#> | |||
SELECT ?Name ?Unit ?Symbol ?Task (?Type AS ?Dependency_Type) WHERE { | |||
# Starting from the central item | |||
wd:{{#invoke:Wd|label|raw|}} wdt:P557 ?centralItem . | |||
?centralItem wdt:P31 wd:Q68663; | |||
wdt:P188 ?url; | |||
rdfs:label ?Label. | |||
# Service query to get tasks and connect them to quantities | |||
SERVICE <https://sparql.mtsr2024.m1.mardi.ovh/mathalgodb/query> { | |||
?url mdb:appliedByTask ?task . | |||
?task rdfs:label ?Task . | |||
# Define type based on connection type (Input or Output) | |||
{ | |||
?task mdb:containsInput ?item . | |||
?item rdfs:label ?Name . | |||
BIND("independent" AS ?Type) | |||
} | |||
UNION | |||
{ | |||
?task mdb:containsOutput ?item . | |||
?item rdfs:label ?Name . | |||
BIND("dependent" AS ?Type) | |||
} | |||
# Filter results to only show defining statements that match the current quantity label | |||
OPTIONAL { | |||
?task mdb:containsFormulation ?formulation . | |||
?formulation mdb:inDefiningFormulation ?definingStatement . | |||
# Convert definingStatement to a plain string to strip off datatype markup | |||
BIND(STR(?definingStatement) AS ?plainStatement) | |||
# Clean up spaces around commas, making the format consistent | |||
BIND(REPLACE(?plainStatement, "\\s*,\\s*", ",") AS ?cleanedStatement) | |||
# Extract symbol and quantity label | |||
BIND(STRBEFORE(?cleanedStatement, ",") AS ?Symbolraw) | |||
BIND(STRAFTER(?cleanedStatement, ",") AS ?quantityLabel) | |||
BIND(REPLACE(?Symbolraw, "\\$", "") AS ?cleanSymbol) | |||
BIND(CONCAT("<math>", ?cleanSymbol, "</math>") AS ?Symbol) | |||
} | |||
BIND(STR(?Name) AS ?plainItemLabel) | |||
FILTER(?quantityLabel = ?plainItemLabel) | |||
} | |||
# Initialize the Unit variable as empty | |||
BIND("" AS ?Unit) | |||
} | |||
ORDER BY ?taskLabel ?itemLabel | |||
| chart=bordercloud.visualization.DataTable | |||
}} | |||
=== Parameters === | |||
{{#sparql: | |||
PREFIX mdb: <https://mardi4nfdi.de/mathmoddb#> | |||
SELECT ?Name ?Unit ?Symbol WHERE { | |||
# Starting from the central item | |||
wd:{{#invoke:Wd|label|raw|}} wdt:P557 ?centralItem . | |||
?centralItem wdt:P31 wd:Q68663; | |||
wdt:P188 ?url; | |||
rdfs:label ?Label. | |||
# Service query to get tasks and connect them to parameters | |||
SERVICE <https://sparql.mtsr2024.m1.mardi.ovh/mathalgodb/query> { | |||
?url mdb:appliedByTask ?task . | |||
?task rdfs:label ?Task . | |||
# Retrieve parameters associated with the task | |||
?task mdb:containsParameter ?item . | |||
?item rdfs:label ?Name . | |||
# Filter results to only show defining statements that match the current quantity label | |||
OPTIONAL { | |||
?task mdb:containsFormulation ?formulation . | |||
?formulation mdb:inDefiningFormulation ?definingStatement . | |||
# Convert definingStatement to a plain string to strip off datatype markup | |||
BIND(STR(?definingStatement) AS ?plainStatement) | |||
# Clean up spaces around commas, making the format consistent | |||
BIND(REPLACE(?plainStatement, "\\s*,\\s*", ",") AS ?cleanedStatement) | |||
# Extract symbol and quantity label | |||
BIND(STRBEFORE(?cleanedStatement, ",") AS ?Symbolraw) | |||
BIND(STRAFTER(?cleanedStatement, ",") AS ?quantityLabel) | |||
BIND(REPLACE(?Symbolraw, "\\$", "") AS ?cleanSymbol) | |||
BIND(CONCAT("<math>", ?cleanSymbol, "</math>") AS ?Symbol) | |||
} | |||
# Initialize the Unit variable as empty | |||
BIND("" AS ?Unit) | |||
} | |||
} | |||
ORDER BY ?Name | |||
| chart=bordercloud.visualization.DataTable | | chart=bordercloud.visualization.DataTable | ||
}} | }} |
Latest revision as of 12:02, 31 October 2024