MatVoc:SPARQL

From matvoc.nims.go.jp
Jump to navigation Jump to search

This vocabulary can be queried by SPARQL at the query service.

See /batch for the queries designed for the batch export system.

Examples

英日両方のラベルが存在する物質タイプ

# Sample query: Narrower concepts of `material types` where both enlabel and jalabel exist
SELECT ?item ?enlabel ?jalabel
WHERE {
  ?item wdt:P8 wd:Q26.
  ?item rdfs:label ?enlabel FILTER (LANG(?enlabel) = "en") .
  ?item rdfs:label ?jalabel FILTER (LANG(?jalabel) = "ja") .
}
ORDER BY ?enlabel

▶️ Try it!

日本語ラベルは存在するが英語のラベルが入力されていないものすべて

# enlabel exists but jalabel not exists
SELECT ?item ?enlabel ?jalabel
WHERE 
{
  ?item rdfs:label ?jalabel FILTER (LANG(?jalabel) = "ja") .
  FILTER(NOT EXISTS {
    ?item rdfs:label ?enlabel FILTER(LANG(?enlabel) = "en") 
  } )
}
ORDER BY ?enlabel

▶️ Try it!