You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Marco Seysse <ma...@web.de> on 2011/05/16 19:46:02 UTC

Jena OWL API and Graph Interface

Dear Jena community,
 
While reading the documentation and class diagramms of the Jena OWL API I figured out to need more information to understand the context.
 
My idea is to search in an OWL-DL ontology for related concepts of one or more given concepts. Since SPARQL just works on RDF level I see just a chance to achieve this by jumping from concept to concept via their relations.
 
Could you offer me some explanation and/or code examples how it is possible to make it work?
 
Or do you know other approaches how to perform semantic searches in an OWL-DL ontology?
 
My second question is about the exact purpose of the “Graph” interface and its relation to the “Model” interface. Does “Graph”   interface stand for one rdf graph and “Model” for the whole collection of linked RDF graphs in an ontology?
 
I hope you can help me further!
 
Best regards,
 
Marco Seysse

___________________________________________________________
Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar

Re: Jena OWL API and Graph Interface

Posted by Ian Dickinson <ia...@epimorphics.com>.
Hi Marco,

On 16/05/11 18:46, Marco Seysse wrote:
> While reading the documentation and class diagramms of the Jena OWL
> API I figured out to need more information to understand the
> context.
>
> My idea is to search in an OWL-DL ontology for related concepts of
> one or more given concepts. Since SPARQL just works on RDF level I
> see just a chance to achieve this by jumping from concept to concept
> via their relations.
Yes, that seems right. Depending on the relationshiops between the 
concepts, you may see rdfs:subClassOf relations between URI's denoting 
concepts, or SKOS relationships, or other connections you add yourself.

> Could you offer me some explanation and/or code examples how it is
> possible to make it work?
Code samples for navigating the RDF model, or running sparql queries, 
are on the various documentation pages. We'd be happy to make more 
specific suggestions, but you'll need to ask a more specific question 
first :)

If your concept scheme is using SKOS, you could broaden a concept to get 
more results, or narrow it to get fewer, more specific results.

E.g

select ?thing ?concept where {
   ?base skos:subject ?base-concept.
   ?base-concept skos:narrower ?concept.
   ?thing skos:subject ?concpept.
}

You can run this query with ?base pre-bound to the resource you are 
interested in (see [1] for one way of doing this)

> Or do you know other approaches how to perform semantic searches in
> an OWL-DL ontology?
Semantic searching is quite a well-researched area. I advise starting 
with the proceedings of the Semantic Search workshops (e.g. [2]) and 
seeing which research themes meet your needs.

> My second question is about the exact purpose of the “Graph”
> interface and its relation to the “Model” interface.
Graph is the more basic internal programming API, where as Model has 
more features and is intended for normal use. You are welcome to use 
Graph if it meets your needs, but that's typically if you're working on 
e.g. Jena extensions or new data source types.

Hth,
Ian


[1] 
http://www.ldodds.com/blog/2005/11/parameterised-queries-with-sparql-and-arq/

[2] https://km.aifb.kit.edu/ws/semsearch11

-- 
____________________________________________________________
Ian Dickinson                   Epimorphics Ltd, Bristol, UK
mailto:ian@epimorphics.com        http://www.epimorphics.com
cell: +44-7786-850536              landline: +44-1275-399069
------------------------------------------------------------
Epimorphics Ltd.  is a limited company registered in England
(no. 7016688). Registered address: Court Lodge, 105 High St,
               Portishead, Bristol BS20 6PT, UK


Re: Jena OWL API and Graph Interface

Posted by Dave Reynolds <da...@gmail.com>.
Hi Marco,

On Mon, 2011-05-16 at 19:46 +0200, Marco Seysse wrote: 
> Dear Jena community,
>  
> While reading the documentation and class diagramms of the Jena OWL API I figured out to need more information to understand the context.
>  
> My idea is to search in an OWL-DL ontology for related concepts of one or more given concepts. Since SPARQL just works on RDF level I see just a chance to achieve this by jumping from concept to concept via their relations.

What to you mean by "their relations" in this case?

OWL concepts are related by things like rdfs:subClassOf relations. Are
those the ones you are trying to follow? If so the OntAPI provides that
straightforwardly.

> Could you offer me some explanation and/or code examples how it is possible to make it work?

There are code examples in the OntAPI documentation:
http://jena.sourceforge.net/ontology/

In order to give you more specific pointers we would need a bit more
detail on what you are trying to do. 

> Or do you know other approaches how to perform semantic searches in an OWL-DL ontology?

The term "semantic search" means many different things to different
people :) Again if you could explain what you are trying to do then
someone might be able to offer suggestions.

> My second question is about the exact purpose of the “Graph” interface and its relation to the “Model” interface. Does “Graph”   interface stand for one rdf graph and “Model” for the whole collection of linked RDF graphs in an ontology?

No.  

Graphs (and the corresponding Node and Triple classes) are internal
constructs. They provide an SPI to make it easier for people
implementing backend stores. The Graph interface is very simple to make
it easy to implement, doesn't provide any convenience functions and is
not limited to the RDF syntactic constraints on which parts of a triple
can be a literal or bNode.

Models (and the corresponding RDFNode/Resource/Literal and Statement
classes) are the normal API that most users should use. A Model is
implemented internally by pointing at a Graph but provides a rather
large number of convenience methods to make it easier to manipulate and
query.

Dave