如何编写此SPARQL请求?

时间:2019-06-30 15:54:18

标签: sparql jena fuseki

如何使用士兵访问所有的士兵军团信息,例如id,regimentifo等 (以下为粗体和斜体)

在输出中,我想要团的价值,即使用士兵47540的56

prefix soldier_regiment: <https://data/soldier_regiment/>
prefix regiment: <https://ssdal/data/regiment/>
prefix soldier: <https://ssdal/datasoldier/> 

soldier_regiment:41
    rdf:type owl:NamedIndividual, :SoldierRegimentInfo ;
    :id 41 ;
    :regimentInfo regiment:56 ;
    :applicableFrom "1938-12-01T00:00:00"^^xsd:dateTime ;
    rdfs:label "Soldier Regiment: 41" .    
soldier:47540 :hasRegiment soldier_regiment:41 .

该查询获取所有的士兵军团详细信息

prefix soldier_regiment: <https://data/>
prefix regiment: <https://ssdal/data/>
prefix soldier: <https://ssdal/> 

select * where { ?s soldier_regiment:id 41; soldier_regiment:regimentInfo ?regimentInfo.
optional{?s soldier_regiment:applicableFrom  ?applicableFrom.}

}

0 个答案:

没有答案