0
我想与rdflib 4.2.1使用属性路径。 下面的类层次结构:类型TShirtWomen,而下面的查询不能使用属性路径与rdflib
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?type where {
:aShirt a/(rdfs:subClassOf)* ?type .
}
我希望看到所有父类,但只收到TShirtWomen:
Clothing
Women
TopsWomen
TShirtWomen
一个实例(aShirt)。
该查询是正确的。你确定数据是正确的,即没有错别字?所有的数据都加载到同一个图表中? – AKSW
如果你不使用SPARQL,它是否工作,即像这里的例子:https://github.com/RDFLib/rdflib/blob/master/examples/foafpaths.py – AKSW