Re: Loading dataset with relative IRIs
> 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 Seabornewrote: > > 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 >> wrote: >>> You cannot. RDF data model is based on absolute URIs. >>> >>> On Tue, Nov 21, 2017 at 3:35 PM, Mohammad Noorani Bakerally < >>> noorani.bakera...@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
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čiuswrote: 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
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čiuswrote: > 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.bakera...@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 < > > marty...@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.bakera...@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
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.bakera...@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 < > marty...@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.bakera...@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
is it possible to explicitly set a base when loading the dataset ? On Tue, Nov 21, 2017 at 3:46 PM, Martynas Jusevičiuswrote: > You cannot. RDF data model is based on absolute URIs. > > On Tue, Nov 21, 2017 at 3:35 PM, Mohammad Noorani Bakerally < > noorani.bakera...@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
You cannot. RDF data model is based on absolute URIs. On Tue, Nov 21, 2017 at 3:35 PM, Mohammad Noorani Bakerally < noorani.bakera...@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 ? >
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 ?