I want to create simple application using Java Jena and SPARQL
,that insert, delete , update and query the OWL/RDF data
I worked on protege to create the ontology and noticed SPARQL in it
but I want to use SPARQL using java and jena ...
1) I saw this thread and I knew how to use SPARQL with jena
(after http)stackoverflow.com/questions/...
I have two queries:
query 1:
SELECT DISTINCT ?o COUNT(?o)
WHERE
{ ?s1 ?somep1 <predicate_one-uri>. ?s1 ?p ?o}
query 2:
SELECT DISTINCT ?o COUNT(?o)
WHERE
{?s2 ?somep2 <predicate_two-uri>.?s2 ?p ?o.}
Each query gives me a different result set (as expected). I need to make a union of these two sets, from what I understand the...
So here's the scenario...I have an XSD file describing all the objects that I need. I can create the objects in Java using JAXB no problem. I have an XML/RDF file that I need to parse into those objects.
What is the EASIEST way to do this?
I have been looking into Jena and have played around with it, but can't see how to easily map th...
Hi,
I have an ontology, which I read in with Jena to help me scrape some RDFa triples from a website. I don't currently store these triples in a Jena model, but that is fairly straight forward to do, its on my to do next list.
The area I am struggling with, though, is to get Jena to output correct RDF for the ontology I have. The ontol...
I'm doing some project which is based on ontology.I want to identify semantic of the text that has entered by user.
Is there any possible way to fulfill my task dealing with ontology through jena?
...
Why does the end point matters so much to the end results of the query.
For this query:
SELECT ?episode,?chalkboard_gag WHERE {
?episode skos:subject
http://dbpedia.org/resource/Category:The_Simpsons_episodes%2C_season_12.
?episode dbpedia2:blackboard ?chalkboard_gag
}
The endpoint "OpenLink Virtuoso SPARQL protocol" returns...
CONSTRUCT is an alternative SPARQL result clause to SELECT. Instead of returning a table of result values, CONSTRUCT returns an RDF graph.
So running this query
PREFIX : http://dbpedia.org/resource/
PREFIX onto: http://dbpedia.org/ontology/
CONSTRUCT {
:France onto:anthem ?x
}
WHERE
{
:France onto:anthem ?x .
}
dont foget the < and...
I'm using servlet for manipulating ontology. I got the result of my SPARQL query and I want to display(print) that result in JSP (Servlet).
Following code segment can be used to print the result in console.
com.hp.hpl.jena.query.Query query = QueryFactory.create(queryStr);
QueryExecution qe = QueryExecutionFactory.create(query,model);
...
i'm new to jena and protege.i did some stuff with these. i have some problems::
1) Do i need to use sparql query to get the ontology classes,subclasses,property and values? or can do it with owl-api? can u show me the way?
2) how to get the data property values?
3) how to i load the ontology that define in my local machine and access th...
i do some development with jena ontology API.my ontology file in my local machine..when i'm going to read the model.. there is an error.. and i made ontology with protege and tried to read that file.
String SOURCE = "http://www.owl-ontologies.com/Ontology1275995702";(it's XML:base value)
//String NS = SOURCE + "#";
//Inp...
I am trying sparql and the use of entailment.
As a example i used http://www.w3.org/TR/2010/WD-sparql11-entailment-20100126/#t112
i try to put them in jena.
OntClass book1= model.createClass(NS+"book1");
OntClass book2=model.createClass(NS+"book2");
OntClass book3=model.createClass(NS+"book3");
OntClass publicatio...
HI,
in my ontology i have the class called "festival" and it has property value called "CRISTMAS". it's a string type value.. son how can i get this value using JENA owl api..
CAN ANY ONE SHOW ME THE WAY ::::::
THANKS
...
InfModel infmodel = ModelFactory.createInfModel(reasoner, m);
Resource vegetarian = infmodel.getResource(source + "Vegetarian");
Resource margherita = infmodel.getResource(source + "Example-Margherita");
if (infmodel.contains(margherita, RDF., vegetarian)) {
System.out.println("Margherita is a memberOf Vegetarian pizza");
}
...
Hello,
I have a problem reading OWL/XML files from Java using Jena.
I have no problem reading RDF/XML files, but whenever I create a OWL/XML file from Protege and try to read it, Java gives this error below :
WARN [main] (RDFDefaultErrorHandler.java:36)
Exception in thread "main" java.lang.NullPointerException
at com.hp.hpl.jena.rdf.a...
Hello,
I have created an RDF/OWL file using Protege 4.1 alpha.
I also created a defined class in Protege called CheapPhone. This class has a restriction which is shown below :
(hasPrice some integer[< 350])
Whenever, a price of a phone is below 350, it is inferred as CheapPhone.
There is no problem for inferring this in Protege 4.1 a...
i have a domian called "festival" and it has some individuals.the property name is "name". i can get the property values of each individuals belongs to festival. how can get the all the values belongs to FESTIVAL domain.. it should be a combination of each individuals property values...
thanks:::
...
Hi. I'm pretty new to SPARQL, OWL and Jena, so please excuse if I'm asking utterly stupid questions. I'm having a problem that is driving me nuts since a couple of days. I'm using the following String as a query for a Jena QueryFactory.create(queryString),
queryString = "PREFIX foaf: <http://xmlns.com/foaf/0.1/>"+
"PREFIX ho: <http:...
how could i add property values in to individuals. i created a new individual called "laknath". then after i need to add the property values to it..
OntClass cul = model.getOntClass("http://www.owl-ontologies.com/Ontology1275995702.owl#person");
Individual ind = model.createIndividual("http://www.owl-ontologies.com/Ontology1275...
i imported Jena packages into my JSP page.
<%@ page import="com.hp.hpl.jena.datatypes.xsd.XSDDatatype" %>
<%@ page import="com.hp.hpl.jena.ontology.DatatypeProperty" %>
<%@ page import="com.hp.hpl.jena.ontology.Individual" %>
<%@ page import="com.hp.hpl.jena.ontology.OntClass" %>
<%@ page import="com.hp.hpl.jena.ontology.OntModel" %>
<...
I tried to add the data type property value in to my model..it works fine..when i wrote like this:
Literal link = model.createTypedLiteral("www.google.lk", XSDDatatype.XSDstring);
Statement value = model.createStatement(ind, pro, link);
model.add(value);
when i pass it as a argument:
Literal link = model.createTypedLiteral(onto.getli...