[英]SPARQL CONSTRUCT subClassOf
i want to create a construct query with triples of subjects, that has a certain subclass.我想创建一个包含三个主题的构造查询,它有一个特定的子类。 That works fine:
这很好用:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX AS: <http://www.w3.org/ns/activitystreams#>
CONSTRUCT {?s ?p ?o}
WHERE {
?s rdf:type/rdfs:subClassOf* AS:Create ;
?p ?o .
}
But now i want to ask for more than one type!但现在我想要求不止一种类型! Something like
就像是
WHERE {
?s rdf:type/rdfs:subClassOf* AS:Create|AS:Announce ;
?p ?o .
}
any idea?任何想法?
You can use a VALUES
clause for this:您可以为此使用
VALUES
子句:
VALUES ?cls {AS:Create AS:Announce} ?s rdf:type/rdfs:subClassOf* ?cls ;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.