- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我在上面运行了这个查询 SPARQL.dbpedia.org/sparql:
select ?resource where {
?resource rdfs:label "Piemonte"@it
}
我得到这个结果:
http://it.dbpedia.org/resource/Categoria:Piemonte
http://it.dbpedia.org/resource/Piemonte
我只想拥有 http://it.dbpedia.org/resource/Piemonte因此。我正在尝试编写此查询 SPARQL 以删除 http://it.dbpedia.org/resource/Categoria:Piemonte从结果来看:
select ?resource where {
?resource rdfs:label "Piemonte"@it
FILTER (rdf:type != skos:Concept)
}
因为我注意到 http://it.dbpedia.org/resource/Categoria:Piemonte具有对象 skos:Concept
而 http://it.dbpedia.org/resource/Piemonte没有,但我得到了相同的结果。为什么?我在这里做错了什么?
我也尝试添加 LIMIT 1
,但结果是 http://it.dbpedia.org/resource/Categoria:Piemonte
,因为结果不是保证顺序相同。
最佳答案
使用像 FILTER (rdf:type != skos:Concept)
这样的过滤器,您只是在询问两个常量是否不相等。当然,URI rdf:type
和 skos:Concept
是不同的。
您想要的是一种资源,它没有属性 rdf:type
的值 skos:Concept
。您可以通过 ?resource rdf:type skos:Concept
表明它确实有那个。因此,您的查询只需要一个过滤器来确保数据中不存在该三元组。在意大利语 DBpedia 上,您可以提出以下问题并只得到一个结果。
select ?resource where {
?resource rdfs:label "Piemonte"@it
filter not exists { ?resource rdf:type skos:Concept }
}
关于java - 如何排除具有特定 rdf :type from SPARQL results? 的资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24167256/
我正在使用 SPARQL,我想知道是否可以在 in 子句中放入 sparql?更具体地说,我需要获取对此 sparql 查询具有特定条件的实体(s1,s2)[s1 在某个字段上的聚合值大于 5] se
我们有办法在 SPARQL 中做一个不减少的累加和吗? 例如, SELECT ?p WHERE { VALUES ?p { 1 1 2 } } ORDER BY ?p 将导致 1 2 4, - 而
在这个小片段中,第二行的 a 是做什么的? CONSTRUCT { ?uri a skos:Concept ; skos:prefLabel ?prefLabel ; 我确
我写了一个 Sparql 查询。 PREFIX table: SELECT ?name ?color FROM WHERE { ?element table:group ?group. ?gro
下面的两个查询有什么区别吗? select distinct ?i where{ ?i rdf:type . FILTER EXISTS { ?i ?b.
我不太明白为什么在SPARQL中他们没有实现基本的逻辑运算符。然而,在大多数情况下,可以通过多种方式获得相同的结果。 这个问题的目的是快速引用可以替代“or”语句的可能方式。 这是我能想到的: 1)联
我的问题很简单:我有一个源my:g1,其中包含: my:a1 my:b "literal 1" 然后我有第二个源my:g2,其中包含: my:a2 my:b my:c. my:c rdfs:label
我在处理数字数据类型时遇到 SPARQL 问题。 我有一个本体 ( http://cabas.ugr.es/ontology/ugr ),我在其中定义了一对属性,表示特定性别的学生人数:
我有以下 SPARQL 查询: PREFIX rdfs: PREFIX type: PREFIX prop: SELECT * WHERE { ?person a foaf:Per
我想知道如何在sparql中表达以下问题: “请告诉我每个 child 都上麻省理工学院的 parent ” 更一般地说,我想知道查询 sparql 的限制是什么?请问数据库中有哪些类型的答案不能
我正在尝试编写一个优雅的 SPARQL,为多个可能的查询提供一个解决方案。我有多个主语和多个谓词,我想接收一个对象。单一解决方案的存在非常不确定,因此我给出了多种选择。如果我没记错的话,这可以通过以下
这是一个关于 Sparql 和 Wikidata 的问题。我想制定一个返回实例类型关系的查询,但如果它不可用,则返回其子类。我尝试过: SELECT DISTINCT ?ent_type WHER
我想做一些类似的事情 { SELECT ?page, "A" AS ?type WHERE { ?s rdfs:label "Microsoft"@en;
我正在尝试进行 SPARQL 查询,该查询返回一个变量,其中包含两个单词,由某些内容分隔。实际上,我尝试获取一个变量,如 ?πληθυσμός_population(希腊语和英语)。但是,我更喜欢与“
我想知道 SPARQL 默认情况下是否采用开放世界假设,或者这是否取决于执行 SPARQL 查询的三元组存储。 这个假设在查询中的含义是什么。 致以诚挚的问候。 最佳答案 嗯.... 我想知道这对于这
我在处理数字数据类型时遇到 SPARQL 问题。 我有一个本体 ( http://cabas.ugr.es/ontology/ugr ),我在其中定义了一对属性,表示特定性别的学生人数:
我正在玩DBPedia . 通过这个查询,我得到了所有出生在伦敦的人: SELECT ?person WHERE { ?person dbo:birthPlace :London } 但
我需要处理 SPARQL 查询。有没有人有很好的链接来学习 SPARQL 查询?我正在寻找有关 SPARQL 查询和示例语法的好文章,以便我可以快速学习。 最佳答案 Lee Feigenbaum 的
我有一个 SPARQL 查询,它在 Virtuoso SPARQL 查询编辑器中运行时提供结果,但相同的查询在 SPARQL 查询验证器中给出语法错误。问题是什么?为什么显示语法错误? PREFIX
我正在运行 sparql 查询 PREFIX rdfs: PREFIX rdfs: SELECT DISTINCT(?film_link) ?film_name ?wiki
我是一名优秀的程序员,十分优秀!