semantic-web

How can I programmatically compute path length using Jena RDF/Ontology API?

别等时光非礼了梦想. 提交于 2019-12-13 15:53:50
问题 I have an RDF Graph with only one relationship(RDFS.subClassOf or is-a) between all the classes. The 'size' of each class is equal to the total number of its subclasses. The 'size' of each RDFS.subClassOf property is 0.5 if it is connecting from a class with fewer total number of subclasses and 1 if it is connecting from class with large total number of subclasses to class with less total number of subclasses. I want to perform an arithmetic sum of all the sizes of each semantic component

What RDF patterns can be used to represent components and the percentage they make up?

。_饼干妹妹 提交于 2019-12-13 14:52:56
问题 I'd like to inventory my wine collection using RDF but am not sure how to specify that wine can contain percentages of several grape varietals. Below is an attempt to do so in Turtle syntax using rdf:bag. @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix vin: <http://example.org/wine#> . <http://example.org/wine/id#1001> a <http://example.org/wine/ns#red> ; vin:name "Quilceda Creek CVR" ; vin:vintage "2014"^^xsd:gYear ; vin

Allegrograph Geospatial Prolog Queries

与世无争的帅哥 提交于 2019-12-13 14:29:44
问题 I have some triples that represent the locations of several cities. I want to be able to fire off a Prolog query like (select (?x ?y ?dist) (q- ?x !exns:geolocation ?locx) (q- ?y !exns:geolocation ?locy) (geo-distance ?locx ?locy ?dist)) but I get this error: Server returned 400: attempt to call '#:geo-distance/3' which is an undefined function. I'd like to understand how to use the geospatial reasoning methods like geo-distance (I assumed it was built-in because they use it here. Is this not

Querying the Linked Movie Database (LMDB) with SPARQL

馋奶兔 提交于 2019-12-13 14:09:43
问题 Given an RDF graph like this: :Matrix [rdfs:label] :The Matrix . :Matrix [movie:id] :23 . :Matrix [movie:actor] :Keanu Reaves . :Matrix [movie:actor] :Laurence Fishburne . :Die Hard 3 [rdfs:label] :Die Hard 3 . :Die Hard 3 [movie:id] :42 . :Die Hard 3 [movie:actor] :Bruce Willis . :Die Hard 3 [movie:actor] :Samuel L. Jackson . and a query like this: SELECT ?id ?name ?actor WHERE { ?instance movie:id ?id . ?instance rdfs:label ?name . ?instance movie:actor ?actor . } I would expect a result

Developing a Semantic Web Application

回眸只為那壹抹淺笑 提交于 2019-12-13 11:18:27
问题 Although i have a little bit of experience in developing dynamic websites using ASP technologies, but I am new to semantic web programming, and i intend to implement a website based on semantic web technology.I would like to develop a search engine, where a web user can query for keywords from the backend RDF triple store.I want to implement the website using Java and JSP.I have following questions: I am currently studying Jena framework and SPARQL to start with,but i am not sure what other

To write a query SPARQL in Java code using strstarts filter

狂风中的少年 提交于 2019-12-13 09:36:54
问题 I would like to write this SPARQL query in Java using Jena: prefix dbpediaont: <http://dbpedia.org/ontology/> prefix dbpedia: <http://dbpedia.org/resource/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?resource where { dbpedia:Fred_Guy rdf:type ?resource filter strstarts(str(?resource), "http://dbpedia.org/ontology") } I'm using this code: public QueryExecution query(){ String stringa = "http://dbpedia.org/resource/Fred_Guy"; ParameterizedSparqlString qs = new

SPARQL and Rules for ontologies

别等时光非礼了梦想. 提交于 2019-12-13 08:56:32
问题 Is it possible to create if/then rules using SPARQL and infer new relationships on my data? For example, could I encode rules like the following? if (blood_sugar > 126 and blood_sugar < 500) then blood_sugar_level = High if (blood_sugar_level = High) then (service = adjust_insulin_dose) 回答1: The question really doesn't provide enough data to figure out exactly what you're trying to do, but you can certainly bind values based on particular conditions. For instance, the following query includes

semantic web services search engine

谁说我不能喝 提交于 2019-12-13 06:26:17
问题 I am searching for a set of semantic web services to test my work. Does anybody know a public web services search engine, or any web services repository in which web services are semantically described (e.g., using OWL-S)? 回答1: Check out these resources OWL for Services (OWL-S) - Examples Collection of OWL-S Web Services 来源: https://stackoverflow.com/questions/17393071/semantic-web-services-search-engine

Pellet Reasoner with Jena

蹲街弑〆低调 提交于 2019-12-13 05:48:13
问题 I am running Pellet with Jena as the following: public void storeInferredModel(Data data) { System.out.println("creating inferred dataset "); Dataset dataset = TDBFactory.createDataset(data.getInferredResultsPath()); System.out.println("creating OntModel "); OntModel Infmodel = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, dataset.getNamedModel(this.URL)); System.out.println("adding schema (OWL) to OntModel"); Infmodel.add(this.owl); System.out.println("adding data (RDF)

how to define a 'co-participate' property in OWL or RDFS?

两盒软妹~` 提交于 2019-12-13 04:52:19
问题 I'd like to know how to express the concept that: if 2 agents are participants in one event, they should be linked with a symmetric property 'co-participate'. I feel I could make some restrictions but don't know how. The event ontology is defined here: http://motools.sourceforge.net/event/event.html 回答1: if 2 agents are participants in one event, they should be linked with a symmetric property 'co-participate'. You can do this in OWL2 by using a sub-property chain axiom. Since the data looks