Template:Workflow: Difference between revisions

From MaRDI portal
T4 reidelbach (talk | contribs)
T4 reidelbach (talk | contribs)
Line 44: Line 44:
<div class="no-pagination no-filter">
<div class="no-pagination no-filter">
{{#sparql:
{{#sparql:
PREFIX mdb: <https://mardi4nfdi.de/mathmoddb#>
SELECT ?itemLabel ?Symbol ?Type ?taskLabel 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.


SELECT ?Name ?Symbol ?Type ?taskLabel WHERE {
   # Service query to get tasks and connect them to quantities
   wd:{{#invoke:Wd|label|raw|}} wdt:P557 ?item .
  ?item wdt:P31 wd:Q68663;
        wdt:P188 ?url;
        rdfs:label ?Label.
   SERVICE <https://sparql.mtsr2024.m1.mardi.ovh/mathalgodb/query> {
   SERVICE <https://sparql.mtsr2024.m1.mardi.ovh/mathalgodb/query> {
         ?url mdb:appliedByTask ?task.
         ?url mdb:appliedByTask ?task .
         ?task rdfs:label ?taskLabel.
         ?task rdfs:label ?taskLabel .
    {
       
        ?task mdb:containsInput ?itemX .
        # Define type based on connection type (Input or Output)
        ?itemX rdfs:label ?itemLabel .
        {
        BIND("independent" AS ?Type)
            ?task mdb:containsInput ?item .
    }
            ?item rdfs:label ?itemLabel .
    UNION
            BIND("independent" AS ?Type)
    {
        }
        ?task mdb:containsOutput ?itemX .
        UNION
        ?itemX rdfs:label ?itemLabel .
        {
        BIND("dependent" AS ?Type)
            ?task mdb:containsOutput ?item .
    }
            ?item rdfs:label ?itemLabel .
    OPTIONAL {
            BIND("dependent" AS ?Type)
             ?formulation mdb:containsQuantity ?itemX ;
        }
                        mdb:containedAsFormulationIn ?task.
       
        # Retrieve inDefiningFormulation statement, clean up spaces, and parse symbol
        OPTIONAL {
             ?formulation mdb:definesQuantity ?item .
             ?formulation mdb:inDefiningFormulation ?definingStatement .
             ?formulation mdb:inDefiningFormulation ?definingStatement .
             BIND(STRBEFORE(?definingStatement, ",") AS ?Symbol)
           
             BIND(STRAFTER(?definingStatement, ", ") AS ?quantityLabel)
            # Clean up spaces around commas, making the format consistent
            BIND(REPLACE(?definingStatement, "\\s*,\\s*", ",") AS ?cleanedStatement)
 
            # Extract symbol and quantity label
             BIND(STRBEFORE(?cleanedStatement, ",") AS ?Symbol)
             BIND(STRAFTER(?cleanedStatement, ",") AS ?quantityLabel)
         }
         }
          
          
        # Filter results to only show defining statements that match the current quantity label
         FILTER(?quantityLabel = ?itemLabel)
         FILTER(?quantityLabel = ?itemLabel)
}
    }
 
}
}
ORDER BY ?taskLabel ?itemLabel
ORDER BY ?taskLabel ?itemLabel

Revision as of 19:08, 29 October 2024


Available identifiers

Problem statement

Object of research and objective

Involved disciplines

    Model

    Variables

    Process information

    Process steps

    Applied methods

    Software used

    Hardware

    Input data

    Output data