sparql

SPARQL Get all the properties from a Class or an Individual

徘徊边缘 提交于 2019-12-06 11:45:29
问题 What I want to do is to get the property list from the Individual1 or from a class, Get all properties from "something" The result should be something like this (for Secret_Data): | Asset_has_Confidentiality_Importance | High | | Asset_has_Availability_Importance....| Moderate | | Asset_has_Integrity_Importance.......| Moderate | | Asset_threatenedBy_ThreatEvent.......| Compromise_sensitive_information | | Asset_threatenedBy_ThreatEvent.......| Disclosure_of_sensitive_information | | Asset

How to get data and object properties of an OWL class by using SPARQL? [duplicate]

这一生的挚爱 提交于 2019-12-06 11:24:32
问题 This question already has answers here : Get all properties for a DBpedia class (2 answers) Closed 5 years ago . I have a complex OWL ontology with many classes. What SPARQL query do I need to use to obtain data and object properties of one OWL class (e.g., Person class)? 回答1: In addition to Jukka Matilainen's answer, there are a few points that should be taken into consideration. OWL is not an object oriented programming language, and the concept of classes and properties are not the same as

Can I configure Jena Fuseki with inference and TDB?

孤街醉人 提交于 2019-12-06 10:39:37
I want to configure Fuseki with an inference model supported by TDB. I have been able to configure it with a Memory Model, but not with a TDB Model where I could update triples. I am using the following assembler description: @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . [] ja:loadClass "com.hp.hpl.jena.tdb.TDB" . tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset . tdb

Number of incoming link fo each DBpedia resource

蓝咒 提交于 2019-12-06 10:01:16
I have the SPARQL DBpedia Query below: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX vrank:<http://purl.org/voc/vrank#> PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> SELECT distinct ?Nom ?resource ?url (count( (?o) as ?nb)) WHERE{ ?resource rdfs:label ?Nom. ?resource foaf:isPrimaryTopicOf ?url. ?resource dbpedia-owl:wikiPageWikiLink ?o ?Nom <bif:contains> "Apple". FILTER ( langMatches( lang(?Nom), "EN" )). MINUS {?resource dbo:wikiPageRedirects|dbo:wikiPageDisambiguates ?dis} } Group By ?Nom ?resource ?url I want to get the number of

Can't PREFIX hierarchies with SPARQL

一笑奈何 提交于 2019-12-06 08:52:40
问题 I have a need to represent a hierarchy in my URL's like this: http://www.me.org/ -----------------root1/ -----------------------level1/ ------------------------------level2/etc I want to define PREFIX's and used them in a SPARQL query like this: PREFIX root1: <http://www.me.org/root1/> select * where { ?s ?p root1:level1/level2/etc . } limit 100 This will fail in ARQ with the following error: Encountered " "/" "/ "" at line 10, column 43. Was expecting one of: "values" ... "graph" ... ...

How I can write SPARQL query that uses similarity measures in Java Code

北城余情 提交于 2019-12-06 08:48:05
I would like to know a simple method to write this SPARQL query in Java Code: select ?input ?string (strlen(?match)/strlen(?string) as ?percent) where { values ?string { "London" "Londn" "London Fog" "Lando" "Land Ho!" "concatenate" "catnap" "hat" "cat" "chat" "chart" "port" "part" } values (?input ?pattern ?replacement) { ("cat" "^x[^cat]*([c]?)[^at]*([a]?)[^t]*([t]?).*$" "$1$2$3") ("Londn" "^x[^Londn]*([L]?)[^ondn]*([o]?)[^ndn]*([n]?)[^dn]*([d]?)[^n]*([n]?).*$" "$1$2$3$4$5") } bind( replace( concat('x',?string), ?pattern, ?replacement) as ?match ) } order by ?pattern desc(?percent) This code

Given a list of company names, how to fetch company names, website url, year established, number of employees etc

家住魔仙堡 提交于 2019-12-06 07:04:09
问题 I have a list of company names such as Microsoft Corp, Kimberly Clark Corporation etc, and for each company, I would like to retrieve fields such as: Its company logo Georgraphic identifier for google maps Website url Year established Stock exchange and stock exchange ticker symbol A way to get the stock prices over the last few days About / abstract from wikipedia A list of subsidiaries and parent companies. For instance, for Boeing it would be Jeppessen and Availl, Inc etc. I have looked

Closing OpenLink Virtuoso HTTP Connections

拈花ヽ惹草 提交于 2019-12-06 06:25:25
We are using OpenLink Virtuoso as the primary database manager for a NodeJS project. We query the database using SPARQL queries only, through the HTTP SPARQL endpoint. For this, we are using the request-promise library, with the following configuration: const queryRequest = rp({ method: "POST", uri: queryObject.fullUrl, form: { query: queryObject.query, maxrows: queryObject.maxRows, format: queryObject.resultsFormat }, headers: { 'content-type': 'application/x-www-form-urlencoded' }, json: true, forever : true, // Keep connections alive instead of creating new ones timeout : Config

SPARQL which is the path connecting two objects?

半世苍凉 提交于 2019-12-06 05:49:51
Hi all I'd like to discover if there is a relation between two nodes and if any the predicates connecting them. Let's say my graph is like following [Uri1] / \ (pred:a) (pred:b) / \ / \ [Uri2] [Uri3] [Uri4] [Uri5] / \ (pred:c) (pred:d) / \ [Uri6] [Uri7] \ (pred:a) \ [Uri8] If the query is looking for the relations between Uri8 and Uri1, the expected result should be [Uri7] = pred:a [Uri2] = pred:d [Uri1] = pred:a Consider that predicates (relations) between nodes may vary and also lengths. the two following: SPARQL: is there any path between two nodes? and Is it possible to return

SPARQL Query Error with OPTION(TRANSITIVE) on Jena

江枫思渺然 提交于 2019-12-06 05:30:56
I have the following Query PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?type WHERE { { SELECT * WHERE { ?x rdfs:subClassOf ?type . } } OPTION (TRANSITIVE, t_distinct, t_in (?x), t_out (?type) ) . FILTER (?x = <http://dbpedia.org/ontology/Hospital>) } It works fine when i send it to Virtuoso endpoint but does not work on my Jena instance. In specific i get the following error: INFO [1] 400 Parse error: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?type WHERE { { SELECT * WHERE { ?x rdfs:subClassOf ?type . } } OPTION (TRANSITIVE, t_distinct, t_in (?x), t_out (?type