rdf

Counting in SPARQL

冷暖自知 提交于 2020-01-01 08:43:22
问题 Ok so i have this query PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT (COUNT(?instance) AS ?count) WHERE { ?instance a <http://dbpedia.org/ontology/Ambassador> . } and the result is 286. Cool. Now I want to get the number of ambassadors that have http://dbpedia.org/property/name property. But PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT (COUNT(?instance) AS ?count) WHERE { ?instance a <http://dbpedia.org/ontology/Ambassador> . ?instance <http:/

RDFS: same property for multiple domains

房东的猫 提交于 2020-01-01 07:03:32
问题 I have an RDFS ontology with two completely separate classes: User and Venue . I want them both to have names which are provided through a property called hasName , which for a User should look similar to: <rdf:Property rdf:ID="hasName"> <rdfs:comment> Comment here. Blah blah blah. </rdfs:comment> <rdfs:domain rdf:resource="#user"/> <rdfs:range rdf:resource="Literal"/> </rdf:Property> However, if I want it for a Venue as well, it doesn't validate. How should I approach this? 回答1: You can in

How can I get a list of all film ids from Freebase?

陌路散爱 提交于 2020-01-01 05:30:12
问题 On a project I was working on a couple of years back, I was building a set of data about movies from Freebase. A simple shell script downloaded the "film.tsv" file (from http://download.freebase.com/datadumps/latest/browse/film/film.tsv). I then used the "id" field in that file to build the necessary MQL requests for each of the films (retrieving the other properties I was interested in e.g. actors, genres). After looking at the developer's guide today I realise that Freebase has moved on a

vCard学习笔记

江枫思渺然 提交于 2020-01-01 02:08:17
vCard 学习笔记 转载时请注明出处: http://blog.csdn.net/absurd/ vCard ?看起来像个专业术语,一下让人敬畏三分。当然这全仰仗着第一个字母 v 了,如果把 v 去掉,剩下的 Card 就是名片的意思,简单得不能再简单了。事实上 vCard 就是一个描述名片的规范。为什么前面加个 v 呢,据说这个规范最初是由 Versit 联盟提出的,至于为什么 v 是小写的,据说是出于技术限制 ( technical restrictions ) ,不懂不懂,也懒得管它了。 奇怪!名片也要规范吗?对大多数人来说,名片就是姓名 + 电话号码,有必要定一个规范吗?当然有必要,任何用于交换的数据都需要定规范,否则大家划不是一套拳,就没有办法交换了。比如一张名片的信息本来为:姓名 : 张三,手机: 13012345678 。在不同的软件中,表现方式可能千差万别,有的表示为 : 张三 , 13012345678 。有的表示为 : name= 张三 ,mobile=13012345678 。 … 总之,种种千奇百怪的写法都有。 有了 vCard 这个规范,大家都按统一的格式描述名片(至少在交换时)。你可以把 outlook 或者 foxmail 中的名片,上传放到手机中,手机可以是 nokia 的,也可以是 moto 的,或者其它任何支持 vCard 的手机

triplestore with revisions

我的梦境 提交于 2019-12-31 16:38:15
问题 I need to store RDF triples, while keeping track of modifications. Is there anything out there for this service? Alternatively, how would you keep track of revision while using a context-aware triplestore ? Edit : please note that I don't need only the changeset. I also need to see the triples at any time in the past. 回答1: I tried to address this sort of thing by storing additional triples describing who said what, when. But you need reification, named graphs, or quads which can ruin

triplestore with revisions

折月煮酒 提交于 2019-12-31 16:36:19
问题 I need to store RDF triples, while keeping track of modifications. Is there anything out there for this service? Alternatively, how would you keep track of revision while using a context-aware triplestore ? Edit : please note that I don't need only the changeset. I also need to see the triples at any time in the past. 回答1: I tried to address this sort of thing by storing additional triples describing who said what, when. But you need reification, named graphs, or quads which can ruin

How to load a gzipped rdf file to rdf4j Repository?

北城以北 提交于 2019-12-31 04:22:32
问题 I want to load a gzipped rdf file into a org.eclipse.rdf4j.repository.Repository . During the upload, status messages must be logged to the console. The size of my rdf file is ~1GB of uncompressed or ~50MB of compressed data. 回答1: Actually an RDF4J repository will automatically process a compressed (zip/gzip) file correctly, already. So you can simply do this: RepositoryConnection conn = ... ; // your store connection conn.add(new File("file.zip"), null, RDFFormat.NTRIPLES): If you want to

Sparql query: find objects with same property objects

可紊 提交于 2019-12-31 03:50:06
问题 Suppose we have a dataset that looks like this: :person :wantsCD :cd1; :wantsCD :cd2 . :storeA :sellsCD :cd1; sellsCD :cd2; sellsCD :cd3 . :storeB :sellsCD :cd1; sellsCD :cd10; sellsCD :cd100 . I'm interested in finding the stores that sell all the CD's :person wants, i.e. ( :storeA ). Is it possible to get this result with a SPARQL query? The query should also work when the number of CD's the :person wants is unknown at runtime. I tried: SELECT DISTINCT ?store ?cd WHERE { :person :wantsCD

getting a graph path using SPARQL [duplicate]

荒凉一梦 提交于 2019-12-31 03:43:10
问题 This question already has an answer here : Querying a Graph path in SPARQL (1 answer) Closed 4 years ago . We have the following turtle dataset representing a graph where we want to observe some properties. @prefix v1: <http://localhost:9091/graphe/> . @prefix v2: <http://localhost:9091/graphe#> . v1:a v2:p v1:b. v1:a v2:q v1:f. v1:a v2:p v1:g. v1:b v2:p v1:c. v1:c v2:q v1:h. v1:c v2:p v1:i. v1:c v2:p v1:d. v1:d v2:p v1:e. v1:f v2:p v1:g. v1:f v2:q v1:l. v1:f v2:p v1:k. v1:g v2:p v1:c. v1:g

How to list and count the different types of node and edge entities in the graph data using SPARQL query?

江枫思渺然 提交于 2019-12-31 03:02:52
问题 I'm looking to provide some summary stats for a data set and I want to list the different types of edge entities and node(vertex) entities in the graph. For example: -> In Twitter Social network graph of users and following relationship (Homogeneous graph), there is only one type of vertex entity (user), but in heterogeneous graphs such as ConceptNet data, it will have multiple values. -> The edge entities can be computed by just counting the different number of predicates I believe using the