Template:Workflow: Difference between revisions
From MaRDI portal
Line 555: | Line 555: | ||
=== Output data === | === Output 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:P1606 ?outputID. | |||
?outputID 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) | |||
# 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 | |||
| options=width=100%! | |||
| endpoint=https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql | |||
}} | |||
</div> |
Revision as of 08:40, 16 December 2024