semantic-web

Finding common categories or supercategories of resources

早过忘川 提交于 2019-12-11 12:57:30
问题 I'm wondering if we can know whether two resources have the same category or some subcategory (i.e., belong to categories of some common supercategory) in DBpedia? I tried this query in the DBpedia endpoint but it's wrong: select distinct ?s ?s2 where { ?s skos:subject <http :// dbpedia.org/resource/ Category ?c. ?s2 skos:subject <http :// dbpedia.org/resource/ Category ?c2. ?c=?c2. } 回答1: DBpedia doesn't use skos:subject for resources, but rather relates resources to their Wikipedia

transform my rdf file to a named graph file

梦想与她 提交于 2019-12-11 12:49:13
问题 For a project I have to use Apache Jena as an API and Blazegraph as a triple store, I am trying to program a code that allows me to transform my dataset (N-Triples File) to a file that contains the NamedGraph of each statement. String APIUrl = "http://localhost:9999/bigdata/namespace/drugbank/sparql"; String req = "select * WHERE {?x ?y ?z}"; RDFConnection conn = RDFConnectionFactory.connect(APIUrl); FileManager.get().addLocatorClassLoader(Main.class.getClassLoader()); Model model =

fuseki config to an in memory with reasoner not working

柔情痞子 提交于 2019-12-11 12:24:15
问题 These settings were working with fuseki 2.0, now i am on fuseki 2.3, but these settings not working any more: [] rdf:type fuseki:Server ; fuseki:services ( <#serviceInMemoryWithReasoner> ) . <#serviceInMemoryWithReasoner> rdf:type fuseki:Service; rdfs:label "testdataset"; fuseki:name "testdataset"; fuseki:serviceQuery "query"; fuseki:serviceUpdate "update"; fuseki:dataset <#datasetServiceInMemoryWithReasoner> ; . <#datasetServiceInMemoryWithReasoner> rdf:type ja:RDFDataset; ja:defaultGraph <

SPARQL if an instance has a property, others must as well

↘锁芯ラ 提交于 2019-12-11 11:45:46
问题 I have a specific instance and a SPARQL query that retrieves other instances similar to that one. By similar, I mean that the other instances have at least one common property and value in common with the specific instance, or have a class in common with the specific instance. Now, I'd like to extend the query such that if the specific instance has a value for a "critical" property, then the only instances that are considered similar are those that also have that critical property (as opposed

SPARQL Query to get Movie detail

荒凉一梦 提交于 2019-12-11 11:45:37
问题 To get movie detail from linkedmdb, I used sparql query : PREFIX mdb: <http://data.linkedmdb.org/resource/movie/film> SELECT DISTINCT ?Title ?Genre ?Actor ?Country ?Director ?Year WHERE { ?film mdb:id ?uri . ?film dc:title ?Title . ?film movie:genre ?filmgenre. ?filmgenre movie:film_genre_name ?Genre . ?film movie:actor ?cast . ?cast movie:actor_name ?Actor . ?film movie:country ?Ctr . ?Ctr movie:country_name ?Country . ?film dc:date ?Year . ?film movie:director ?Drc . ?Drc movie:director

Find individuals in SPARQL based on other relations / Compare sets

时光毁灭记忆、已成空白 提交于 2019-12-11 11:19:12
问题 Given are Objects :A, :B and :C which have properties assigned, whereas these properties are not scalar themselves but are also objects with key and value properties. @prefix x: <http://example.com/example#> x:A x:hasProp x:Prop1 . x:Prop1 x:Key "1" . x:Prop1 x:Value "AA" . x:B x:hasProp x:Prop2 . x:Prop2 x:Key "1" . x:Prop2 x:Value "AA" . x:C x:hasProp x:Prop3 . x:C x:hasProp x:Prop4 . x:Prop3 x:Key "1" . x:Prop3 x:Value "AA" . x:Prop4 x:Key "2" . x:Prop4 x:Value "BB" . How can I assert that

why inference is not working well

荒凉一梦 提交于 2019-12-11 10:46:21
问题 I have two ontologies which i join them together in one big ontology This is in the big ontology <!-- http://www.MusicSemanticOntology/mso#r1 --> <owl:NamedIndividual rdf:about="http://www.MusicSemanticOntology/mso#r1"> <rdf:type rdf:resource="http://semanticrecommender.com/rs#Rates"/> <rs:about rdf:resource="http://music.org/musicontology/mo#5th_Symphony"/> <rs:createdOn rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">1956-06-25T04:00:00-05:00</rs:createdOn> <rs:ratesBy rdf:datatype

owl:TransitiveProperty in query

对着背影说爱祢 提交于 2019-12-11 10:33:42
问题 I have done a family tree. I also defined transitive property: childOf. Now I want to make SPARQL Query which give me all descendants of one of members of family. How can I do it? Thanks 回答1: If your triple store supports OWL reasoning and you've defined your childOf property to be transitive (shouldn't it be called descendantOf by the way!), then it should infer childOf properties directly between all related nodes. So, it should be enough to query it like this (prefixes omitted for brevity)

SPARQL - learning by example

十年热恋 提交于 2019-12-11 09:42:45
问题 In short, if someone instructs me, "Get a list of databases which include Oracle, Mysql, DB2, MSSQL, etc.," how can I actually establish which fields and information I need to create the query? I downloaded DBpedia and grepped the triples, e.g., $ `grep 'Oracle' * | grep 'Database' article_categories_en.nt:<http://dbpedia.org/resource/Oracle_Database> <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category:Relational_database_management_systems> .` How do I create a SPARQL