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 <aj...@virginia.edu>:

> 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 <marty...@graphity.org>
> 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
> > <valerio.belcas...@gmail.com> 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 <aj...@virginia.edu>:
> >>
> >>> 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 <
> >>> valerio.belcas...@gmail.com> 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
> >>>
> >>>
>
>

Reply via email to