Template:Workflow: Difference between revisions

From MaRDI portal
No edit summary
T4 reidelbach (talk | contribs)
 
(124 intermediate revisions by 2 users not shown)
Line 12: Line 12:
=== Involved disciplines ===
=== Involved disciplines ===
<ol>{{#invoke:wd|properties|P437|format=<li>%p</li>}}</ol>
<ol>{{#invoke:wd|properties|P437|format=<li>%p</li>}}</ol>
== Model ==
<div class="no-pagination no-filter">
{{#sparql:
PREFIX mdb: <https://mardi4nfdi.de/mathmoddb#>
SELECT ?Label ?Description ?Time ?Space WHERE {
  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> {
        ?url rdfs:comment ?Description;
        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
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql
}}
</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("&lt;math&gt;", ?cleanSymbol, "&lt;/math&gt;") 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
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql
}}
=== 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("&lt;math&gt;", ?cleanSymbol, "&lt;/math&gt;") AS ?Symbol)
        }
        # Initialize the Unit variable as empty
        BIND("" AS ?Unit)
    }
}
ORDER BY ?Name
| chart=bordercloud.visualization.DataTable
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql
}}


== Process information ==
== Process information ==
=== Process steps ===
=== Process steps ===
<div class="no-pagination no-filter">
{{#sparql:
{{#sparql:
SELECT ?Number
SELECT ?Number
Line 106: Line 242:
| chart=bordercloud.visualization.DataTable
| chart=bordercloud.visualization.DataTable
| options=width=100%!
| options=width=100%!
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql
}}
}}
 
</div>
=== Applied methods ===
=== Applied methods ===
<div class='no-pagination no-filter'>
{{#sparql:
{{#sparql:
SELECT ?ID
SELECT ?ID
Line 162: Line 300:
| chart=bordercloud.visualization.DataTable
| chart=bordercloud.visualization.DataTable
| options=width=100%!
| options=width=100%!
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql
}}
}}
</div>


=== Software used ===
=== Software used ===
 
<div class='no-pagination no-filter'>
{{#sparql:
{{#sparql:
SELECT ?ID
SELECT ?ID
Line 172: Line 312:
       ?Version
       ?Version
       (GROUP_CONCAT(DISTINCT ?plLink; separator=", ") AS ?ProgrammingLanguage)
       (GROUP_CONCAT(DISTINCT ?plLink; separator=", ") AS ?ProgrammingLanguage)
      (GROUP_CONCAT(DISTINCT ?dpLink; separator=", ") AS ?Dependencies)
      ?versioned
      ?published
      ?documented
        
        
WHERE {
WHERE {
Line 207: Line 351:
       '') as ?plQID)
       '') as ?plQID)
     BIND (CONCAT('<a href=\'/wiki/Item:',?plQID,'\'>',?plLabel,'</a>') as ?plLink)
     BIND (CONCAT('<a href=\'/wiki/Item:',?plQID,'\'>',?plLabel,'</a>') as ?plLink)
  } 
  # Get Dependencies
  OPTIONAL {
    ?softwareID wdt:P342 ?dpID.
    ?dpID rdfs:label ?dpLabel.
    FILTER (lang(?dpLabel) = 'en')
    BIND(replace( xsd:string(?dpID),
      'https://portal.mardi4nfdi.de/entity/',
      '') as ?dpQID)
    BIND (CONCAT('<a href=\'/wiki/Item:',?dpQID,'\'>',?dpLabel,'</a>') as ?dpLink)
   }
   }
 
  # Versioned
  BIND (IF(BOUND(?Version), "Yes", "No") AS ?versioned)
 
  # Published
  OPTIONAL {
    ?softwareID wdt:P339 ?srcREPO.
  }
  BIND (IF(BOUND(?srcREPO), CONCAT('<a href="', STR(?srcREPO), '">Yes</a>'), "No") AS ?published)
 
  # Documented
  OPTIONAL {
    ?softwareID wdt:P340 ?docu.
  }
  BIND (IF(BOUND(?docu), CONCAT('<a href="', STR(?docu), '">Yes</a>'), "No") AS ?documented)
 
  }
  }
GROUP BY ?ID ?Name ?Description ?Version
GROUP BY ?ID ?Name ?Description ?Version ?versioned ?published ?documented
| chart=bordercloud.visualization.DataTable
| chart=bordercloud.visualization.DataTable
| options=width=100%!
| options=width=100%!
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql
}}
}}
</div>


=== Hardware ===
=== Hardware ===
 
<div class='no-pagination no-filter'>
{{#sparql:
{{#sparql:
SELECT ?ID
SELECT ?ID
Line 265: Line 437:
| chart=bordercloud.visualization.DataTable
| chart=bordercloud.visualization.DataTable
| options=width=100%!
| options=width=100%!
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql
}}
}}
</div>


=== Input data ===
=== Input data ===
<div class="no-pagination no-filter">
{{#sparql:
SELECT ?ID
      ?Name
      ?Size
      ?DataStructure
      ?ExchangeFormat
      ?BinaryOrText
      ?Proprietary
      ?toPublish
      ?toArchive
     
WHERE {
 
  # Get Step
  wd:{{#invoke:Wd|label|raw|}} p:P557 ?mainStatement.
  ?mainStatement ps:P557 ?stepID.
  ?stepID wdt:P31 wd:Q6486603.           
 
  # Get Data
  OPTIONAL {
    ?stepID wdt:P1605 ?inputID.
    ?inputID rdfs:label ?NameLabel.
    FILTER (lang(?NameLabel) = 'en')
   
    BIND(replace( xsd:string(?inputID),
      'https://portal.mardi4nfdi.de/entity/',
      '') as ?qid)
   
    BIND(CONCAT('mardi:','<a href=\'/wiki/Item:',?qid,'\'>',?qid,'</a>') as ?ID)
    BIND(CONCAT('<a href=\'/wiki/Item:',?qid,'\'>',?NameLabel,'</a>') as ?Name)


=== Output data ===
  # Data Size (maps to Size if File etc size is provided)
  OPTIONAL {
    ?inputID p:P1542 ?statementNode.         
    ?statementNode psv:P1542 ?valueNode.     
    ?valueNode wikibase:quantityAmount ?size;
              wikibase:quantityUnit ?unit.
    ?unit rdfs:label ?unitlabel.
    FILTER (lang(?unitlabel) = 'en')
    BIND(CONCAT(STR(?size), ' ', STR(?unitlabel)) AS ?Size)
}
 
  # Number of Records (maps to Size if Number of Entries in a Database etc is provided=
  OPTIONAL {
    ?inputID wdt:P139 ?Sizeraw
    BIND(CONCAT(STR(?Sizeraw),' Items') as ?Size)
  }
 
  # Data Structure
  OPTIONAL {
    ?inputID wdt:P1193 ?DataStructure
    }
   
  # Exchange Format
  OPTIONAL {
    ?inputID wdt:P921 ?ExchangeFormat
    }
 
  # Binary or Text
  BIND(IF(EXISTS { ?inputID wdt:P31 wd:Q6480276 }, "binary", IF(EXISTS { ?inputID wdt:P31 wd:Q6534207 }, "text", "" )) AS ?BinaryOrText)
 
  # Proprietary
  BIND(IF(EXISTS { ?inputID wdt:P31 wd:Q6480367 }, "yes", IF(EXISTS { ?inputID wdt:P31 wd:Q6480313 }, "no", "" )) AS ?Proprietary)
 
  # Bind DOI and URL if they exist
  OPTIONAL { ?inputID wdt:P23 ?doi. }
  OPTIONAL { ?inputID wdt:P188 ?url. }
 
  # Data Publishing
  BIND(
  IF(EXISTS { ?inputID wdt:P1563 wd:Q6480291 },
    IF(EXISTS { ?inputID wdt:P27 ?doi },
        CONCAT('<a href="', 'https://dx.doi.org', STR(?doi), '">yes</a>'),
        IF(EXISTS { ?inputID wdt:P188 ?url },
          CONCAT('<a href="', STR(?url), '">yes</a>'),
          "yes"
        )
    ),
    "no"
  ) AS ?toPublish
)
 
# Data Archiving
 
  OPTIONAL {
  ?inputID p:P1563 ?statementNode.
  ?statementNode ps:P1563 wd:Q6480370.
  OPTIONAL {
    ?statementNode pq:P411 ?endTime.
  }
}


=== MathModDB test ===
BIND(
  IF(BOUND(?statementNode),
    IF(BOUND(?endTime),
        SUBSTR(STR(?endTime), 1, 4),
        "yes"
    ),
    "no"
  ) AS ?toArchive
)
   
  }
} GROUP BY ?ID ?Name ?Size ?DataStructure ?ExchangeFormat ?BinaryOrText ?Proprietary ?toPublish ?toArchive


<!--
| chart=bordercloud.visualization.DataTable
| options=width=100%!
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql
}}
</div>
 
=== Output data ===
<div class="no-pagination no-filter">
{{#sparql:
{{#sparql:
PREFIX : <https://mardi4nfdi.de/mathmoddb#>
SELECT ?ID
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
      ?Name
                             
      ?Size
SELECT DISTINCT ?answer ?label ?quote
      ?DataStructure
      ?ExchangeFormat
      ?BinaryOrText
      ?Proprietary
      ?toPublish
      ?toArchive
     
WHERE {
WHERE {
                ?answer a :MathematicalModel .
 
                OPTIONAL {?answer rdfs:label ?labelraw .
  # Get Step
                                    FILTER (lang(?labelraw) = 'en')}
  wd:{{#invoke:Wd|label|raw|}} p:P557 ?mainStatement.
                BIND(COALESCE(?labelraw, "No Label Provided!") AS ?label)
  ?mainStatement ps:P557 ?stepID.
                OPTIONAL {?answer rdfs:comment ?quoteraw.
  ?stepID wdt:P31 wd:Q6486603.           
                                    FILTER (lang(?quoteraw) = 'en')}
 
                BIND(COALESCE(?quoteraw, "No Description Provided!") AS ?quote)
  # Get Data
              }
  OPTIONAL {
GROUP BY ?answer ?label ?quote
    ?stepID wdt:P1606 ?outputID.
LIMIT 5
    ?outputID rdfs:label ?NameLabel.
    FILTER (lang(?NameLabel) = 'en')
   
    BIND(replace( xsd:string(?outputID),
      'https://portal.mardi4nfdi.de/entity/',
      '') as ?qid)
   
    BIND(CONCAT('mardi:','<a href=\'/wiki/Item:',?qid,'\'>',?qid,'</a>') as ?ID)
    BIND(CONCAT('<a href=\'/wiki/Item:',?qid,'\'>',?NameLabel,'</a>') as ?Name)
 
  # Data Size (maps to Size if File etc size is provided)
  OPTIONAL {
    ?outputID p:P1542 ?statementNode.         
    ?statementNode psv:P1542 ?valueNode.     
    ?valueNode wikibase:quantityAmount ?size;
              wikibase:quantityUnit ?unit.
    ?unit rdfs:label ?unitlabel.
    FILTER (lang(?unitlabel) = 'en')
    BIND(CONCAT(STR(?size), ' ', STR(?unitlabel)) AS ?Size)
}
 
  # Number of Records (maps to Size if Number of Entries in a Database etc is provided=
  OPTIONAL {
    ?outputID wdt:P139 ?Sizeraw
    BIND(CONCAT(STR(?Sizeraw),' Items') as ?Size)
  }
 
  # Data Structure
  OPTIONAL {
    ?outputID wdt:P1193 ?DataStructure
    }
   
  # Exchange Format
  OPTIONAL {
    ?outputID wdt:P921 ?ExchangeFormat
    }
 
  # Binary or Text
  BIND(IF(EXISTS { ?outputID wdt:P31 wd:Q6480276 }, "binary", IF(EXISTS { ?outputID wdt:P31 wd:Q6534207 }, "text", "" )) AS ?BinaryOrText)
 
  # Proprietary
  BIND(IF(EXISTS { ?outputID wdt:P31 wd:Q6480367 }, "yes", IF(EXISTS { ?outputID wdt:P31 wd:Q6480313 }, "no", "" )) AS ?Proprietary)
 
  # Bind DOI and URL if they exist
  OPTIONAL { ?outputID wdt:P23 ?doi. }
  OPTIONAL { ?outputID wdt:P188 ?url. }
 
  # Data Publishing
  BIND(
  IF(EXISTS { ?outputID wdt:P1563 wd:Q6480291 },
    IF(EXISTS { ?outputID wdt:P27 ?doi },
        CONCAT('<a href="', 'https://dx.doi.org', STR(?doi), '">yes</a>'),
        IF(EXISTS { ?outputID wdt:P188 ?url },
          CONCAT('<a href="', STR(?url), '">yes</a>'),
          "yes"
        )
    ),
    "no"
  ) AS ?toPublish
)
 
# Data Archiving
 
  OPTIONAL {
  ?outputID p:P1563 ?statementNode.
  ?statementNode ps:P1563 wd:Q6480370.
  OPTIONAL {
    ?statementNode pq:P411 ?endTime.
  }
}
 
BIND(
  IF(BOUND(?statementNode),
    IF(BOUND(?endTime),
        SUBSTR(STR(?endTime), 1, 4),
        "yes"
    ),
    "no"
  ) AS ?toArchive
)
   
  }
} GROUP BY ?ID ?Name ?Size ?DataStructure ?ExchangeFormat ?BinaryOrText ?Proprietary ?toPublish ?toArchive
 
| chart=bordercloud.visualization.DataTable
| chart=bordercloud.visualization.DataTable
| endpoint=https://sparql.mtsr2024.m1.mardi.ovh/mathalgodb/query
| options=width=100%!
}}-->
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql
}}
</div>


== Reproducibility ==
<div class='no-pagination no-filter'>
{{#sparql:
{{#sparql:
PREFIX mdb: <https://mardi4nfdi.de/mathmoddb#>
SELECT ?Mathematically
      ?Runtime
      ?Result
      ?OriginalPlatform
      ?CrossPlatform
      ?Transferability
     
WHERE {


SELECT ?label ?comment ?isDeterministic ?isDynamic ?isLinear ?isConvex ?isDimensionless WHERE {
  # Mathematical Reproducibility
  wd:{{#invoke:Wd|label|raw|}} wdt:P557 ?item .
  OPTIONAL {
  ?item wdt:P31 wd:Q68663;
    wd:{{#invoke:Wd|label|raw|}} p:P31 ?math_statement.
        wdt:P188 ?url;
    ?math_statement ps:P31 wd:Q6534210.
        rdfs:label ?label.
    BIND("Yes" AS ?math_hasTriple)
  SERVICE <https://sparql.mtsr2024.m1.mardi.ovh/mathalgodb/query> {
    OPTIONAL {
        ?url rdfs:comment ?comment;       
      ?math_statement pq:P8 ?math_text.
            mdb:isDeterministic ?isDeterministic;
      BIND(CONCAT("Yes: ", STR(?math_text)) AS ?math_result)
            mdb:isDynamic ?isDynamic;
      }
            mdb:isLinear ?isLinear;
  }
            mdb:isConvex ?isConvex;
  BIND(IF(BOUND(?math_result), ?math_result, IF(BOUND(?math_hasTriple), "Yes", "No")) AS ?Mathematically)
            mdb:isDimensionless ?isDimensionless; 
 
  }
  # Runtime Reproducibility
  OPTIONAL {
    wd:{{#invoke:Wd|label|raw|}} p:P31 ?run_statement.
    ?run_statement ps:P31 wd:Q6534211.
    BIND("Yes" AS ?run_hasTriple)
    OPTIONAL {
      ?run_statement pq:P8 ?run_text.
      BIND(CONCAT("Yes: ", STR(?run_text)) AS ?run_result)
      }
  }
  BIND(IF(BOUND(?run_result), ?run_result, IF(BOUND(?run_hasTriple), "Yes", "No")) AS ?Runtime)
 
  # Result Reproducibility
  OPTIONAL {
    wd:{{#invoke:Wd|label|raw|}} p:P31 ?res_statement.
    ?res_statement ps:P31 wd:Q6534212.
    BIND("Yes" AS ?res_hasTriple)
    OPTIONAL {
      ?res_statement pq:P8 ?res_text.
      BIND(CONCAT("Yes: ", STR(?res_text)) AS ?res_result)
      }
  }
  BIND(IF(BOUND(?res_result), ?res_result, IF(BOUND(?res_hasTriple), "Yes", "No")) AS ?Result)
 
  # Original Platform Reproducibility
  OPTIONAL {
    wd:{{#invoke:Wd|label|raw|}} p:P31 ?plat_statement.
    ?plat_statement ps:P31 wd:Q6534213.
    BIND("Yes" AS ?plat_hasTriple)
    OPTIONAL {
      ?plat_statement pq:P8 ?plat_text.
      BIND(CONCAT("Yes: ", STR(?plat_text)) AS ?plat_result)
      }
  }
  BIND(IF(BOUND(?plat_result), ?plat_result, IF(BOUND(?plat_hasTriple), "Yes", "No")) AS ?OriginalPlatform)
 
  # Cross Platform Reproducibility
  OPTIONAL {
    wd:{{#invoke:Wd|label|raw|}} p:P31 ?xplat_statement.
    ?xplat_statement ps:P31 wd:Q6534214.
    BIND("Yes" AS ?xplat_hasTriple)
    OPTIONAL {
      ?xplat_statement pq:P8 ?xplat_text.
      BIND(CONCAT("Yes: ", STR(?xplat_text)) AS ?xplat_result)
      }
  }
  BIND(IF(BOUND(?xplat_result), ?xplat_result, IF(BOUND(?xplat_hasTriple), "Yes", "No")) AS ?CrossPlatform)
 
  # Transferability
  OPTIONAL {
    wd:{{#invoke:Wd|label|raw|}} p:P31 ?trans_statement.
    ?trans_statement ps:P31 wd:Q6534215.
    BIND("Yes" AS ?trans_hasTriple)
    OPTIONAL {
      ?trans_statement pq:P8 ?trans_text.
      BIND(CONCAT("Yes: ", STR(?trans_text)) AS ?trans_result)
      }
  }
  BIND(IF(BOUND(?trans_result), ?trans_result, IF(BOUND(?trans_hasTriple), "Yes", "No")) AS ?Transferability)
}
}
| headers = Mathematical&nbsp;model,Description,Deterministic,Dynamic,Linear,Convex,Dimensionless
GROUP BY ?Mathematically ?Runtime ?Result ?OriginalPlatform ?CrossPlatform ?Transferability
 
| chart=bordercloud.visualization.DataTable
| options=width=100%!
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql
}}
}}
</div>

Latest revision as of 10:00, 17 December 2024


Available identifiers

Problem statement

Object of research and objective

Involved disciplines

    Model

    Variables

    Parameters

    Process information

    Process steps

    Applied methods

    Software used

    Hardware

    Input data

    Output data

    Reproducibility