I'm trying to implement this interface BaseRDFTripleModel <http://art.uniroma2.it/owlart/documentation/apidocs/it/uniroma2/art/owlart/models/BaseRDFTripleModel.html> which has a method called listNamespaces(). The Sesame implementation of this method is achieved by simply calling the getNamespaces() method of RepositoryConnection class. I was looking for something similar to Sesame implementation which could be done using Jena. I haven't written nothing yet.
Questa e-mail è stata inviata da un computer privo di virus protetto da Avast. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2> 2016-03-04 2:28 GMT+01:00 A. Soroka <[email protected]>: > The class to which you refer is not a Jena type at all and has no > connection with the Jena Graph type. The fact that the Sesame > RepositoryConnection type understands namespace prefixes in no way implies > that any particular Jena type will do the same thing in the same way. I’m > not sure there is any Jena type that could even be said to represent the > same abstraction as a Sesame Repository or RepositoryConnection. They're > two different and entirely independent software projects. > > Can you give us something of the code you are trying to write? I have a > feeling that there is some kind of earlier misunderstanding here that is > leading to you trying to use both Jena and Sesame types together in this > way. > > --- > A. Soroka > The University of Virginia Library > > > On Mar 3, 2016, at 8:16 PM, Valerio Belcastro < > [email protected]> wrote: > > > > I want to achieve the same behavior of getNamespaces() > > < > http://rdf4j.org/sesame/2.7/apidocs/org/openrdf/repository/RepositoryConnection.html#getNamespaces() > > > > method > > from Sesame RepositoryConnection > > < > http://rdf4j.org/sesame/2.7/apidocs/org/openrdf/repository/RepositoryConnection.html > > > > class. This method returns associations between prefixes and namespaces. > > Here is an output example: > > > > :: http://example.org/book/ > > ns :: http://example.org/ns# > > vcard :: http://www.w3.org/2001/vcard-rdf/3.0# > > dc :: http://purl.org/dc/elements/1.1/ > > > > I know that i can retrieve all namespaces from a Jena model using > > listNameSpaces() method, but I also need prefixes (like example above) > > > > 2016-03-04 0:33 GMT+01:00 A. Soroka <[email protected]>: > > > >> Yes, this was my point: a SPARQL (RDF) dataset is not a syntactic > >> construct. It is a collection of graphs defined by its behavior. > >> > >> If you could write some more about your use case for this mechanism, we > >> might be able to help you resolve it by some other means… > >> > >> --- > >> A. Soroka > >> The University of Virginia Library > >> > >>> On Mar 3, 2016, at 6:27 PM, Martynas Jusevičius <[email protected] > > > >> wrote: > >>> > >>> As far as I understand, prefix mapping is only available after > >>> parsing, as it's a purely syntactic thing. Some syntaxes have prefixes > >>> (Turtle or RDF/XML, for example), some don't (N-Triples). So in > >>> general you cannot retrieve them, as there is no such thing in the RDF > >>> data model. I might be wrong though :) > >>> > >>> On Fri, Mar 4, 2016 at 12:22 AM, Valerio Belcastro > >>> <[email protected]> wrote: > >>>> Jena Graph class has the method getPrefixMapping() > >>>> < > >> > https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/graph/Graph.html#getPrefixMapping-- > >>> . > >>>> This method returns a map that associates prefixes to their uri. I > would > >>>> like to achieve the same behaviour with a remote graph without using > >>>> DatasetAccessor. > >>>> > >>>> 2016-03-03 23:12 GMT+01:00 A. Soroka <[email protected]>: > >>>> > >>>>> If you are talking about a graph accessed via SPARQL, it’s not clear > >> (to > >>>>> me) what you mean by “prefix mapping”. A SPARQL dataset doesn’t have > a > >>>>> prefix mapping that is constant between queries. Is there something > >> else > >>>>> you mean by the term? > >>>>> > >>>>> --- > >>>>> A. Soroka > >>>>> The University of Virginia Library > >>>>> > >>>>>> On Mar 3, 2016, at 4:00 PM, Valerio Belcastro < > >>>>> [email protected]> wrote: > >>>>>> > >>>>>> Hi guys, > >>>>>> > >>>>>> Is it possible to get prefix mapping from remote graph in Jena? > >>>>>> > >>>>>> I know that I can get a model (and then its prefix mapping) through > >>>>>> DatasetAccessor class, but I think it is too much expensive when > >> using a > >>>>>> model containing large amounts of triples. Is there another way to > >>>>> achieve > >>>>>> this or am I missing something? > >>>>>> > >>>>>> thank you in advance > >>>>> > >>>>> > >> > >> > >
