You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Mohammad Noorani Bakerally <no...@gmail.com> on 2017/11/21 14:35:06 UTC

Loading dataset with relative IRIs

I have a dataset in a trig file with resources having relative iris, when
loading them with the method RDFDataMgr.loadDataset, all the relative IRIs
are converted to absolute iris, how can I prevent this, I want them to
retain their relative IRIs ? ‌

Re: Loading dataset with relative IRIs

Posted by Mohammad Noorani Bakerally <no...@gmail.com>.
The link you gave I didn't, I was checking the RDFParser (
http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFParser.html
),

thanks for the link,




‌

On Tue, Nov 21, 2017 at 4:03 PM, Martynas Jusevičius <martynas@atomgraph.com
> wrote:

> Yes. Did you look at the JavaDoc?
> https://jena.apache.org/documentation/javadoc/arq/org/
> apache/jena/riot/RDFDataMgr.html#read-org.apache.jena.
> query.Dataset-java.lang.String-java.lang.String-org.apache.jena.riot.Lang-
>
> On Tue, Nov 21, 2017 at 3:54 PM, Mohammad Noorani Bakerally <
> noorani.bakerally@gmail.com> wrote:
>
> > is it possible to explicitly set a base when loading the dataset ?
> >
> >
> >
> > ‌
> >
> > On Tue, Nov 21, 2017 at 3:46 PM, Martynas Jusevičius <
> > martynas@atomgraph.com
> > > wrote:
> >
> > > You cannot. RDF data model is based on absolute URIs.
> > >
> > > On Tue, Nov 21, 2017 at 3:35 PM, Mohammad Noorani Bakerally <
> > > noorani.bakerally@gmail.com> wrote:
> > >
> > > > I have a dataset in a trig file with resources having relative iris,
> > when
> > > > loading them with the method RDFDataMgr.loadDataset, all the relative
> > > IRIs
> > > > are converted to absolute iris, how can I prevent this, I want them
> to
> > > > retain their relative IRIs ? ‌
> > > >
> > >
> >
>

Re: Loading dataset with relative IRIs

Posted by Martynas Jusevičius <ma...@atomgraph.com>.
Yes. Did you look at the JavaDoc?
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#read-org.apache.jena.query.Dataset-java.lang.String-java.lang.String-org.apache.jena.riot.Lang-

On Tue, Nov 21, 2017 at 3:54 PM, Mohammad Noorani Bakerally <
noorani.bakerally@gmail.com> wrote:

> is it possible to explicitly set a base when loading the dataset ?
>
>
>
> ‌
>
> On Tue, Nov 21, 2017 at 3:46 PM, Martynas Jusevičius <
> martynas@atomgraph.com
> > wrote:
>
> > You cannot. RDF data model is based on absolute URIs.
> >
> > On Tue, Nov 21, 2017 at 3:35 PM, Mohammad Noorani Bakerally <
> > noorani.bakerally@gmail.com> wrote:
> >
> > > I have a dataset in a trig file with resources having relative iris,
> when
> > > loading them with the method RDFDataMgr.loadDataset, all the relative
> > IRIs
> > > are converted to absolute iris, how can I prevent this, I want them to
> > > retain their relative IRIs ? ‌
> > >
> >
>

Re: Loading dataset with relative IRIs

Posted by ajs6f <aj...@apache.org>.
> BUT if you get relative URIs into the dataset, don't expect everything else to work seamlessly. e.g. SPARQL - in syntax, relative URIs are resolved.

Amen. For example, if you serve this data via Fuseki you may find that clients have problems because their requests are getting resolved with respect to unexpected bases.

Really not a good road to go down.

ajs6f

> On Nov 21, 2017, at 10:28 AM, Andy Seaborne <an...@apache.org> wrote:
> 
> As Martynas says, RDF is defined in terms of absolute URIs.
> 
> It is MUCH better to invent a base like "http://myBase/".
> 
> For Trig, IRI resolution relative the base is always done and there is always a base, RIOT will insert http://base reading from an input stream for TriG.
> 
> The only bypass is to read in N-Quads from an input stream.
> 
> BUT if you get relative URIs into the dataset, don't expect everything else to work seamlessly.  e.g. SPARQL - in syntax, relative URIs are resolved.
> 
>    Andy
> 
> On 21/11/17 14:54, Mohammad Noorani Bakerally wrote:
>> is it possible to explicitly set a base when loading the dataset ?
>> ‌
>> On Tue, Nov 21, 2017 at 3:46 PM, Martynas Jusevičius <martynas@atomgraph.com
>>> wrote:
>>> You cannot. RDF data model is based on absolute URIs.
>>> 
>>> On Tue, Nov 21, 2017 at 3:35 PM, Mohammad Noorani Bakerally <
>>> noorani.bakerally@gmail.com> wrote:
>>> 
>>>> I have a dataset in a trig file with resources having relative iris, when
>>>> loading them with the method RDFDataMgr.loadDataset, all the relative
>>> IRIs
>>>> are converted to absolute iris, how can I prevent this, I want them to
>>>> retain their relative IRIs ? ‌
>>>> 
>>> 


Re: Loading dataset with relative IRIs

Posted by Andy Seaborne <an...@apache.org>.
As Martynas says, RDF is defined in terms of absolute URIs.

It is MUCH better to invent a base like "http://myBase/".

For Trig, IRI resolution relative the base is always done and there is 
always a base, RIOT will insert http://base reading from an input stream 
for TriG.

The only bypass is to read in N-Quads from an input stream.

BUT if you get relative URIs into the dataset, don't expect everything 
else to work seamlessly.  e.g. SPARQL - in syntax, relative URIs are 
resolved.

     Andy

On 21/11/17 14:54, Mohammad Noorani Bakerally wrote:
> is it possible to explicitly set a base when loading the dataset ?
> 
> 
> 
> ‌
> 
> On Tue, Nov 21, 2017 at 3:46 PM, Martynas Jusevičius <martynas@atomgraph.com
>> wrote:
> 
>> You cannot. RDF data model is based on absolute URIs.
>>
>> On Tue, Nov 21, 2017 at 3:35 PM, Mohammad Noorani Bakerally <
>> noorani.bakerally@gmail.com> wrote:
>>
>>> I have a dataset in a trig file with resources having relative iris, when
>>> loading them with the method RDFDataMgr.loadDataset, all the relative
>> IRIs
>>> are converted to absolute iris, how can I prevent this, I want them to
>>> retain their relative IRIs ? ‌
>>>
>>
> 

Re: Loading dataset with relative IRIs

Posted by Mohammad Noorani Bakerally <no...@gmail.com>.
is it possible to explicitly set a base when loading the dataset ?



‌

On Tue, Nov 21, 2017 at 3:46 PM, Martynas Jusevičius <martynas@atomgraph.com
> wrote:

> You cannot. RDF data model is based on absolute URIs.
>
> On Tue, Nov 21, 2017 at 3:35 PM, Mohammad Noorani Bakerally <
> noorani.bakerally@gmail.com> wrote:
>
> > I have a dataset in a trig file with resources having relative iris, when
> > loading them with the method RDFDataMgr.loadDataset, all the relative
> IRIs
> > are converted to absolute iris, how can I prevent this, I want them to
> > retain their relative IRIs ? ‌
> >
>

Re: Loading dataset with relative IRIs

Posted by Martynas Jusevičius <ma...@atomgraph.com>.
You cannot. RDF data model is based on absolute URIs.

On Tue, Nov 21, 2017 at 3:35 PM, Mohammad Noorani Bakerally <
noorani.bakerally@gmail.com> wrote:

> I have a dataset in a trig file with resources having relative iris, when
> loading them with the method RDFDataMgr.loadDataset, all the relative IRIs
> are converted to absolute iris, how can I prevent this, I want them to
> retain their relative IRIs ? ‌
>