475,243
edits
(→Food Composition Tables in WikiFCD: add timeline fct with pub date query) |
(→Food Items with SMILING Cambodia Food Code and Reference: add DHA ranked list query) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 112: | Line 112: | ||
}} | }} | ||
Limit 100 | Limit 100 | ||
</SPARQL> | |||
==Federated Query WikiFCD PFaF with Optional Image== | |||
<SPARQL> | |||
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |||
PREFIX wd: <http://www.wikidata.org/entity/> | |||
PREFIX wbt: <https://wikifcd.wikibase.cloud/prop/direct/> | |||
PREFIX wb: <https://wikifcd.wikibase.cloud/entity/> | |||
SELECT DISTINCT ?food ?foodLabel ?taxon ?value (SAMPLE (?img) AS ?image) | |||
WHERE { | |||
?food wbt:P73 ?taxon. | |||
?taxon wbt:P61 ?wikidata. | |||
?food rdfs:label ?foodLabel . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?wikidata wdt:P4301 ?value. | |||
OPTIONAL {?wikidata wdt:P18 ?img.} | |||
}} | |||
GROUP BY ?food ?foodLabel ?taxon ?value | |||
</SPARQL> | |||
==Food Items with SMILING Cambodia Food Code and Reference== | |||
<SPARQL> | |||
PREFIX wd: <http://www.wikidata.org/entity/> | |||
PREFIX wbt: <https://wikifcd.wikibase.cloud/prop/direct/> | |||
PREFIX wb: <https://wikifcd.wikibase.cloud/entity/> | |||
PREFIX p: <https://wikifcd.wikibase.cloud/prop/> | |||
PREFIX pr: <https://wikifcd.wikibase.cloud/prop/reference/> | |||
PREFIX prov: <http://www.w3.org/ns/prov#> | |||
SELECT ?food ?foodLabel ?code WHERE { | |||
?food wbt:P313 ?code; | |||
p:P313 [ prov:wasDerivedFrom [pr:P62 wb:Q128052]]. | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |||
} | |||
</SPARQL> | |||
==Ranked List of Food Items Containing Most to Least DHA (Docosahexaenoic acid)== | |||
<SPARQL> | |||
PREFIX wd: <http://www.wikidata.org/entity/> | |||
PREFIX wbt: <https://wikifcd.wikibase.cloud/prop/direct/> | |||
PREFIX wb: <https://wikifcd.wikibase.cloud/entity/> | |||
PREFIX p: <https://wikifcd.wikibase.cloud/prop/> | |||
PREFIX psv: <https://wikifcd.wikibase.cloud/prop/statement/value/> | |||
SELECT ?itemLabel ?_DHA ?unitLabel WHERE { | |||
?item p:P135/psv:P135 ?DHA. | |||
?DHA wikibase:quantityAmount ?_DHA. | |||
?DHA wikibase:quantityUnit ?unit. | |||
{ SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"} }} | |||
ORDER BY DESC(?_DHA) | |||
</SPARQL> | </SPARQL> |