Re: OntModel.read parsing non-suffixed TTL as RDF/XML

2018-03-13 Thread Lewis John McGibbney
Hi Dave,
Coming back to this to address some thing I missed before

On 2018/03/07 08:57:47, Dave Reynolds  wrote: 

> OntModels use a somewhat older stack of tools (FileManager) which 
> guesses the language based on the suffix, with a default of RDF/XML, and 
> then relies on content negotiation to deliver the guessed format. Since 
> your resources don't support conneg 

The resources do. For example, SWEET is served with conneg as per the following
http://sweetontoligy.net/sweetAll (returns default TTL)
http://sweetontoligy.net/sweetAll.ttl (explicitly returns TTL)
http://sweetontoligy.net/sweetAll.rdf (returns non-default RDFXML)

> and don't support RDF/XML (the 
> official default) that's not going to work.

Ths issue I see is that even if I return the following ontology 
(http://sweetontoligy.net/sweetAll.rdf) resource as RDFXML, the imports 
contained within this resource e.g. http://sweetontology.net/relaHuman are 
parsed as RDFXML when they should be parsed as TTL e.g. the default 
manifestation.

> 
> One option might be to create a subclass of FileManager which overrides 
> readModelWorker to either load the data via the newer RDFDataMgr which 
> has more sophisticated conneg support, or to change the default syntax 
> to Turtle. Then install that FileManager in the OntDocumentManager you 
> use for your loading.
> 

Yes, I can see from the stack trace that FileManager is being called as follows

at 
org.apache.jena.util.FileManager.readModelWorker(FileManager.java:375)
at org.apache.jena.util.FileManager.readModel(FileManager.java:342)
at org.apache.jena.util.FileManager.readModel(FileManager.java:326)

This in turn invokes readers expecting XML input, which is not the case... 
I'll go ahead and implement the suggested fx as above.
Thanks again,
Lewis


Re: OntModel.read parsing non-suffixed TTL as RDF/XML

2018-03-13 Thread Lewis John McGibbney
Thanks Andy, OK I've added this dependency to the project and te result is just 
the same. I am going to try Dave's suggestion.
Thanks
Lewis

On 2018/03/13 18:51:06, Andy Seaborne  wrote: 
> 
> 
> On 13/03/18 18:44, Lewis John McGibbney wrote:
> > Hi Andy,
> > This is correct.
> > Do you suggest I augment the classpath?
> > Thank you
> > Lewis
> 
> Yes:
> 
>
>  org.apache.jena
>  apache-jena-libs
>  pom
>  X.Y.Z
>
> 
> > 
> > On 2018/03/07 17:01:43, Andy Seaborne  wrote:
> >>
> >>
> >> On 07/03/18 10:59, Andy Seaborne wrote:
> >>> Lewis - which version? Do yo have all the apache-jena-libs jars on the
> >>> classpath?  RIOT rewirers Jena model reading.
> >>
> >> It looks like you only have jena-core of some version on the classpath.
> >>
> >>>
> >>> Also, there was an issue around redirect and remapping but it's fixed.
> >>>
> >>>       Andy
> >>>
> >>> On 07/03/18 08:57, Dave Reynolds wrote:
> >>>> I can't tell from the trace whether you are mapping the import URLs to
> >>>> local files or are loading directly from the URL. If loading from
> >>>> local files then you really need suffixes on those. I'll assume you
> >>>> are loading from the URL ...
> >>>>
> >>>> OntModels use a somewhat older stack of tools (FileManager) which
> >>>> guesses the language based on the suffix, with a default of RDF/XML,
> >>>> and then relies on content negotiation to deliver the guessed format.
> >>>> Since your resources don't support conneg and don't support RDF/XML
> >>>> (the official default) that's not going to work.
> >>>>
> >>>> One option might be to create a subclass of FileManager which
> >>>> overrides readModelWorker to either load the data via the newer
> >>>> RDFDataMgr which has more sophisticated conneg support, or to change
> >>>> the default syntax to Turtle. Then install that FileManager in the
> >>>> OntDocumentManager you use for your loading.
> >>>>
> >>>> Dave
> >>>>
> >>>>
> >>>> On 07/03/18 04:28, lewis john mcgibbney wrote:
> >>>>> Hi Folks,
> >>>>>
> >>>>> Over on the SWEET ontology suite [0] we recently changed out canonical
> >>>>> serialization to TTL. Additionally however, we removed all file suffixes
> >>>>> from the resources themselves, therefore although the following resource
> >>>>> [1] is serialized as TTL, you would never know unless you looked at
> >>>>> it or
> >>>>> peeked into the server response.
> >>>>>
> >>>>> I am experiencing issues when I attempt to load the SWEET 'master' file
> >>>>> [2], which essentially produces a graph by importing every file
> >>>>> within the
> >>>>> ontology suite. The code I use to do this is as follows.
> >>>>>
> >>>>> ((OntModel) m).read(url, null, lang); //Where lang is the string
> >>>>> "TTL" or
> >>>>> "TURTLE" depending on previous logic.
> >>>>>
> >>>>> The stack trace I get is as follows [3]
> >>>>>
> >>>>> As you can see it loads the sweetAll file correctly but chokes on the
> >>>>> imported resource http://sweetontology.net/realmSoil, which is also a
> >>>>> TTL
> >>>>> serialization but with no file suffix. The stack trace indicates that an
> >>>>> attempt is being made to parse the resource as RDF/XML... which in this
> >>>>> case is incorrect.
> >>>>>
> >>>>> Any hints on how to override/define this behaviour?
> >>>>>
> >>>>> Another related question, the large stack trace I receive from the above
> >>>>> parsing activity seems to also indicate that the OntModel.read logic
> >>>>> randomly processes imports when processing a resource such as [2]. Is
> >>>>> this
> >>>>> correct?
> >>>>>
> >>>>> Thanks for any hits folks, I appreciate it.
> >>>>> Lewis
> >>>>>
> >>>>> [0] http://sweetontology.net
> >>>>> [1] http://sweetontology.net/reprDataProduct
> >>>>> [2] http://sweetontology.net/sweetAll
> >>>>> [3] https://paste.apache.org/vLt8
> >>>>>
> >>
> 


Re: OntModel.read parsing non-suffixed TTL as RDF/XML

2018-03-13 Thread Lewis John McGibbney
Hi Andy,
This is correct.
Do you suggest I augment the classpath?
Thank you
Lewis

On 2018/03/07 17:01:43, Andy Seaborne  wrote: 
> 
> 
> On 07/03/18 10:59, Andy Seaborne wrote:
> > Lewis - which version? Do yo have all the apache-jena-libs jars on the 
> > classpath?  RIOT rewirers Jena model reading.
> 
> It looks like you only have jena-core of some version on the classpath.
> 
> > 
> > Also, there was an issue around redirect and remapping but it's fixed.
> > 
> >      Andy
> > 
> > On 07/03/18 08:57, Dave Reynolds wrote:
> >> I can't tell from the trace whether you are mapping the import URLs to 
> >> local files or are loading directly from the URL. If loading from 
> >> local files then you really need suffixes on those. I'll assume you 
> >> are loading from the URL ...
> >>
> >> OntModels use a somewhat older stack of tools (FileManager) which 
> >> guesses the language based on the suffix, with a default of RDF/XML, 
> >> and then relies on content negotiation to deliver the guessed format. 
> >> Since your resources don't support conneg and don't support RDF/XML 
> >> (the official default) that's not going to work.
> >>
> >> One option might be to create a subclass of FileManager which 
> >> overrides readModelWorker to either load the data via the newer 
> >> RDFDataMgr which has more sophisticated conneg support, or to change 
> >> the default syntax to Turtle. Then install that FileManager in the 
> >> OntDocumentManager you use for your loading.
> >>
> >> Dave
> >>
> >>
> >> On 07/03/18 04:28, lewis john mcgibbney wrote:
> >>> Hi Folks,
> >>>
> >>> Over on the SWEET ontology suite [0] we recently changed out canonical
> >>> serialization to TTL. Additionally however, we removed all file suffixes
> >>> from the resources themselves, therefore although the following resource
> >>> [1] is serialized as TTL, you would never know unless you looked at 
> >>> it or
> >>> peeked into the server response.
> >>>
> >>> I am experiencing issues when I attempt to load the SWEET 'master' file
> >>> [2], which essentially produces a graph by importing every file 
> >>> within the
> >>> ontology suite. The code I use to do this is as follows.
> >>>
> >>> ((OntModel) m).read(url, null, lang); //Where lang is the string 
> >>> "TTL" or
> >>> "TURTLE" depending on previous logic.
> >>>
> >>> The stack trace I get is as follows [3]
> >>>
> >>> As you can see it loads the sweetAll file correctly but chokes on the
> >>> imported resource http://sweetontology.net/realmSoil, which is also a 
> >>> TTL
> >>> serialization but with no file suffix. The stack trace indicates that an
> >>> attempt is being made to parse the resource as RDF/XML... which in this
> >>> case is incorrect.
> >>>
> >>> Any hints on how to override/define this behaviour?
> >>>
> >>> Another related question, the large stack trace I receive from the above
> >>> parsing activity seems to also indicate that the OntModel.read logic
> >>> randomly processes imports when processing a resource such as [2]. Is 
> >>> this
> >>> correct?
> >>>
> >>> Thanks for any hits folks, I appreciate it.
> >>> Lewis
> >>>
> >>> [0] http://sweetontology.net
> >>> [1] http://sweetontology.net/reprDataProduct
> >>> [2] http://sweetontology.net/sweetAll
> >>> [3] https://paste.apache.org/vLt8
> >>>
> 


Re: OntModel.read parsing non-suffixed TTL as RDF/XML

2018-03-13 Thread Lewis John McGibbney
Hi Andy,
This is Jena 3.6.0.
Lewis

On 2018/03/07 10:59:42, Andy Seaborne  wrote: 
> Lewis - which version? Do yo have all the apache-jena-libs jars on the 
> classpath?  RIOT rewirers Jena model reading.
> 
> Also, there was an issue around redirect and remapping but it's fixed.
> 
>   Andy
> 
> On 07/03/18 08:57, Dave Reynolds wrote:
> > I can't tell from the trace whether you are mapping the import URLs to 
> > local files or are loading directly from the URL. If loading from local 
> > files then you really need suffixes on those. I'll assume you are 
> > loading from the URL ...
> > 
> > OntModels use a somewhat older stack of tools (FileManager) which 
> > guesses the language based on the suffix, with a default of RDF/XML, and 
> > then relies on content negotiation to deliver the guessed format. Since 
> > your resources don't support conneg and don't support RDF/XML (the 
> > official default) that's not going to work.
> > 
> > One option might be to create a subclass of FileManager which overrides 
> > readModelWorker to either load the data via the newer RDFDataMgr which 
> > has more sophisticated conneg support, or to change the default syntax 
> > to Turtle. Then install that FileManager in the OntDocumentManager you 
> > use for your loading.
> > 
> > Dave
> > 
> > 
> > On 07/03/18 04:28, lewis john mcgibbney wrote:
> >> Hi Folks,
> >>
> >> Over on the SWEET ontology suite [0] we recently changed out canonical
> >> serialization to TTL. Additionally however, we removed all file suffixes
> >> from the resources themselves, therefore although the following resource
> >> [1] is serialized as TTL, you would never know unless you looked at it or
> >> peeked into the server response.
> >>
> >> I am experiencing issues when I attempt to load the SWEET 'master' file
> >> [2], which essentially produces a graph by importing every file within 
> >> the
> >> ontology suite. The code I use to do this is as follows.
> >>
> >> ((OntModel) m).read(url, null, lang); //Where lang is the string "TTL" or
> >> "TURTLE" depending on previous logic.
> >>
> >> The stack trace I get is as follows [3]
> >>
> >> As you can see it loads the sweetAll file correctly but chokes on the
> >> imported resource http://sweetontology.net/realmSoil, which is also a TTL
> >> serialization but with no file suffix. The stack trace indicates that an
> >> attempt is being made to parse the resource as RDF/XML... which in this
> >> case is incorrect.
> >>
> >> Any hints on how to override/define this behaviour?
> >>
> >> Another related question, the large stack trace I receive from the above
> >> parsing activity seems to also indicate that the OntModel.read logic
> >> randomly processes imports when processing a resource such as [2]. Is 
> >> this
> >> correct?
> >>
> >> Thanks for any hits folks, I appreciate it.
> >> Lewis
> >>
> >> [0] http://sweetontology.net
> >> [1] http://sweetontology.net/reprDataProduct
> >> [2] http://sweetontology.net/sweetAll
> >> [3] https://paste.apache.org/vLt8
> >>
> 


Re: OntModel.read parsing non-suffixed TTL as RDF/XML

2018-03-13 Thread Lewis John McGibbney
Hi Dave,
Thank you for the response,

On 2018/03/07 08:57:47, Dave Reynolds  wrote: 
> I can't tell from the trace whether you are mapping the import URLs to 
> local files or are loading directly from the URL. If loading from local 
> files then you really need suffixes on those. I'll assume you are 
> loading from the URL ...

Correct. It is from the URL.

> 
> OntModels use a somewhat older stack of tools (FileManager) which 
> guesses the language based on the suffix, with a default of RDF/XML, and 
> then relies on content negotiation to deliver the guessed format. Since 
> your resources don't support conneg and don't support RDF/XML (the 
> official default) that's not going to work.
> 
> One option might be to create a subclass of FileManager which overrides 
> readModelWorker to either load the data via the newer RDFDataMgr which 
> has more sophisticated conneg support, or to change the default syntax 
> to Turtle. Then install that FileManager in the OntDocumentManager you 
> use for your loading.

I will try this and let you know.
Thank you 
Lewis

> 
> Dave
> 
> 
> On 07/03/18 04:28, lewis john mcgibbney wrote:
> > Hi Folks,
> > 
> > Over on the SWEET ontology suite [0] we recently changed out canonical
> > serialization to TTL. Additionally however, we removed all file suffixes
> > from the resources themselves, therefore although the following resource
> > [1] is serialized as TTL, you would never know unless you looked at it or
> > peeked into the server response.
> > 
> > I am experiencing issues when I attempt to load the SWEET 'master' file
> > [2], which essentially produces a graph by importing every file within the
> > ontology suite. The code I use to do this is as follows.
> > 
> > ((OntModel) m).read(url, null, lang); //Where lang is the string "TTL" or
> > "TURTLE" depending on previous logic.
> > 
> > The stack trace I get is as follows [3]
> > 
> > As you can see it loads the sweetAll file correctly but chokes on the
> > imported resource http://sweetontology.net/realmSoil, which is also a TTL
> > serialization but with no file suffix. The stack trace indicates that an
> > attempt is being made to parse the resource as RDF/XML... which in this
> > case is incorrect.
> > 
> > Any hints on how to override/define this behaviour?
> > 
> > Another related question, the large stack trace I receive from the above
> > parsing activity seems to also indicate that the OntModel.read logic
> > randomly processes imports when processing a resource such as [2]. Is this
> > correct?
> > 
> > Thanks for any hits folks, I appreciate it.
> > Lewis
> > 
> > [0] http://sweetontology.net
> > [1] http://sweetontology.net/reprDataProduct
> > [2] http://sweetontology.net/sweetAll
> > [3] https://paste.apache.org/vLt8
> > 
> 


Re: OntModel.read parsing non-suffixed TTL as RDF/XML

2018-03-13 Thread Lewis John McGibbney
Hi Laura,
Sorry for late response.
Right now that is unquantified...
We are engaged in ontology alignment activities such as 
https://github.com/ESIPFed/sweet/tree/master/alignments
With other initiatives listed in our issue tracker
https://github.com/ESIPFed/sweet/issues
I 'was' going to try analyzing WebDataCommons to see if SWEET URI's were 
contained anywhere.
http://www.webdatacommons.org/
I will say however, that SWEET is included in several OGC 
recommendations/standards. I am in the process of updating these documents to 
use the new http://sweetontology.net URI scheme.
If you are interested in joining the community get us below
https://github.com/ESIPFed/sweet#community

Lewis

On 2018/03/07 06:20:15, "Laura Morales"  wrote: 
> Sorry for the OT question but it's the first time I learn about SWEET. Is 
> there any list of datasets/graphs using this vocabulary?
>  
>  
> 
> Sent: Wednesday, March 07, 2018 at 5:28 AM
> From: "lewis john mcgibbney" 
> To: users@jena.apache.org
> Subject: OntModel.read parsing non-suffixed TTL as RDF/XML
> Hi Folks,
> 
> Over on the SWEET ontology suite [0] we recently changed out canonical
> serialization to TTL. Additionally however, we removed all file suffixes
> from the resources themselves, therefore although the following resource
> [1] is serialized as TTL, you would never know unless you looked at it or
> peeked into the server response.
> 
> I am experiencing issues when I attempt to load the SWEET 'master' file
> [2], which essentially produces a graph by importing every file within the
> ontology suite. The code I use to do this is as follows.
> 
> ((OntModel) m).read(url, null, lang); //Where lang is the string "TTL" or
> "TURTLE" depending on previous logic.
> 
> The stack trace I get is as follows [3]
> 
> As you can see it loads the sweetAll file correctly but chokes on the
> imported resource http://sweetontology.net/realmSoil, which is also a TTL
> serialization but with no file suffix. The stack trace indicates that an
> attempt is being made to parse the resource as RDF/XML... which in this
> case is incorrect.
> 
> Any hints on how to override/define this behaviour?
> 
> Another related question, the large stack trace I receive from the above
> parsing activity seems to also indicate that the OntModel.read logic
> randomly processes imports when processing a resource such as [2]. Is this
> correct?
> 
> Thanks for any hits folks, I appreciate it.
> Lewis
> 
> [0] http://sweetontology.net[http://sweetontology.net]
> [1] 
> http://sweetontology.net/reprDataProduct[http://sweetontology.net/reprDataProduct]
> [2] http://sweetontology.net/sweetAll[http://sweetontology.net/sweetAll]
> [3] https://paste.apache.org/vLt8[https://paste.apache.org/vLt8]
> 
> --
> http://home.apache.org/~lewismc/[http://home.apache.org/~lewismc/]
> http://people.apache.org/keys/committer/lewismc
> 


OntModel.read parsing non-suffixed TTL as RDF/XML

2018-03-06 Thread lewis john mcgibbney
Hi Folks,

Over on the SWEET ontology suite [0] we recently changed out canonical
serialization to TTL. Additionally however, we removed all file suffixes
from the resources themselves, therefore although the following resource
[1] is serialized as TTL, you would never know unless you looked at it or
peeked into the server response.

I am experiencing issues when I attempt to load the SWEET 'master' file
[2], which essentially produces a graph by importing every file within the
ontology suite. The code I use to do this is as follows.

((OntModel) m).read(url, null, lang); //Where lang is the string "TTL" or
"TURTLE" depending on previous logic.

The stack trace I get is as follows [3]

As you can see it loads the sweetAll file correctly but chokes on the
imported resource http://sweetontology.net/realmSoil, which is also a TTL
serialization but with no file suffix. The stack trace indicates that an
attempt is being made to parse the resource as RDF/XML... which in this
case is incorrect.

Any hints on how to override/define this behaviour?

Another related question, the large stack trace I receive from the above
parsing activity seems to also indicate that the OntModel.read logic
randomly processes imports when processing a resource such as [2]. Is this
correct?

Thanks for any hits folks, I appreciate it.
Lewis

[0] http://sweetontology.net
[1] http://sweetontology.net/reprDataProduct
[2] http://sweetontology.net/sweetAll
[3] https://paste.apache.org/vLt8

-- 
http://home.apache.org/~lewismc/
http://people.apache.org/keys/committer/lewismc


Re: Accessing Fuseki server outside local network.

2013-08-27 Thread Lewis John Mcgibbney
thanks Andy
Lewis

On Tuesday, August 27, 2013, Andy Seaborne  wrote:
> It can certainly be accessed directly - I seem to spend my time stopping
that!
>
> Port 3030 may well be bloked by a firefall somewhere.
>
> We tend to run it behind httpd (or equiv in nginx).
>
> e.g.
>
> 
>   ServerName www.sparql.org
>   ServerAlias sparql.org
>   ProxyRequests off
>   
> Order deny,allow
> Allow from all
>   
>   ProxyPass / http://127.0.0.1:3030/ max=4
>   ProxyPassReverse / http://127.0.0.1:3030/
>   ProxyPreserveHost On
> 
>
> You can start it on a different port using --port
>
> Andy
>
> On 27/08/13 00:15, Lewis John Mcgibbney wrote:
>>
>> Hi Rob,
>> Thank you so much for this. Great.
>> Best
>> Lewis
>>
>>
>> On Mon, Aug 26, 2013 at 3:30 PM, Rob Vesse  wrote:
>>
>>> Lewis
>>>
>>> It will depend heavily on the configuration of the system that you run
the
>>> Fuseki instance on around both its host name and its firewall
>>>
>>> Firstly Fuseki by default binds to the given port (default 3030) on all
>>> hosts, so from your local machine both localhost:3030 and hostname:3030
>>> should work
>>>
>>> As far as accessing outside your machine that is going to be driven by
the
>>> hosts firewall configuration.  A standard firewall configuration in most
>>> host OSes should not permit port 3030 to be accessible from outside the
>>> machine.  You will need to modify your firewall configuration on your
host
>>> to allow inbound TCP/IP traffic on port 3030
>>>
>>> If your host needs to be accessible from beyond the local network the
you
>>> may need to look at changing firewall configuration on your network
>>> hub/router/switch to allow inbound connections on this port from outside
>>> of the network and possibly to enable port forwarding to from the public
>>> IP of your hub/router/switch to your internal IP if the server does not
>>> have a public IP address.
>>>
>>> On the client side you should just be able to access hostname:3030
unless
>>> your client side firewall has rules on outgoing traffic (which most
>>> typically won't) though if after allowing inbound connections on the
>>> server you have problems accessing from some (but not all clients) then
>>> this would be the next thing to investigate.
>>>
>>> Hope this helps, apologies for being low on specifics but firewall
>>> configuration utilities vary widely between OS and even more so when you
>>> get to the network router/switch/hub level.
>>>
>>> Rob
>>>
>>>
>>> On 8/26/13 3:22 PM, "Lewis John Mcgibbney" 
>>> wrote:
>>>
>>>> Hi All,
>>>> Ideally, I would like to run Fuseki inside Tomcat (I am therefore
>>>> monitoring JENA-201 and also offering to put time into getting HTML
pages
>>>> supported in there) so that I can access my web app outside of local
>>>> network.
>>>> However this made me think that it would be strange if this were not
>>>> already possible.
>>>> I start Jetty on localhost:3030 but I am not able to access it from an
>>>> external (to localhost) client.
>>>> Can someone point me in the right direction here to access the Fuseki
>>>> instance on localhost:3030 from my mobile 3G network for example?
>>>> Thank you very much in advance.
>>>> Best
>>>> Lewis
>>>>
>>>> --
>>>> *Lewis*
>>>
>>>
>>
>>
>
>

-- 
*Lewis*


Re: Accessing Fuseki server outside local network.

2013-08-26 Thread Lewis John Mcgibbney
Hi Rob,
Thank you so much for this. Great.
Best
Lewis


On Mon, Aug 26, 2013 at 3:30 PM, Rob Vesse  wrote:

> Lewis
>
> It will depend heavily on the configuration of the system that you run the
> Fuseki instance on around both its host name and its firewall
>
> Firstly Fuseki by default binds to the given port (default 3030) on all
> hosts, so from your local machine both localhost:3030 and hostname:3030
> should work
>
> As far as accessing outside your machine that is going to be driven by the
> hosts firewall configuration.  A standard firewall configuration in most
> host OSes should not permit port 3030 to be accessible from outside the
> machine.  You will need to modify your firewall configuration on your host
> to allow inbound TCP/IP traffic on port 3030
>
> If your host needs to be accessible from beyond the local network the you
> may need to look at changing firewall configuration on your network
> hub/router/switch to allow inbound connections on this port from outside
> of the network and possibly to enable port forwarding to from the public
> IP of your hub/router/switch to your internal IP if the server does not
> have a public IP address.
>
> On the client side you should just be able to access hostname:3030 unless
> your client side firewall has rules on outgoing traffic (which most
> typically won't) though if after allowing inbound connections on the
> server you have problems accessing from some (but not all clients) then
> this would be the next thing to investigate.
>
> Hope this helps, apologies for being low on specifics but firewall
> configuration utilities vary widely between OS and even more so when you
> get to the network router/switch/hub level.
>
> Rob
>
>
> On 8/26/13 3:22 PM, "Lewis John Mcgibbney" 
> wrote:
>
> >Hi All,
> >Ideally, I would like to run Fuseki inside Tomcat (I am therefore
> >monitoring JENA-201 and also offering to put time into getting HTML pages
> >supported in there) so that I can access my web app outside of local
> >network.
> >However this made me think that it would be strange if this were not
> >already possible.
> >I start Jetty on localhost:3030 but I am not able to access it from an
> >external (to localhost) client.
> >Can someone point me in the right direction here to access the Fuseki
> >instance on localhost:3030 from my mobile 3G network for example?
> >Thank you very much in advance.
> >Best
> >Lewis
> >
> >--
> >*Lewis*
>
>


-- 
*Lewis*


Accessing Fuseki server outside local network.

2013-08-26 Thread Lewis John Mcgibbney
Hi All,
Ideally, I would like to run Fuseki inside Tomcat (I am therefore
monitoring JENA-201 and also offering to put time into getting HTML pages
supported in there) so that I can access my web app outside of local
network.
However this made me think that it would be strange if this were not
already possible.
I start Jetty on localhost:3030 but I am not able to access it from an
external (to localhost) client.
Can someone point me in the right direction here to access the Fuseki
instance on localhost:3030 from my mobile 3G network for example?
Thank you very much in advance.
Best
Lewis

-- 
*Lewis*


Re: Obtaining only object's from Model

2013-08-20 Thread Lewis John Mcgibbney
Hi Joshua,

Thanks for reply

On Tue, Aug 20, 2013 at 6:40 PM, Joshua TAYLOR wrote:

>
> It's sort of surprising to me that you don't seem to care about what
> subjects those properties and values are attached to, but at any rate,
> if that's really what you want to do, then
>

This is because I know 'exactly' what is in the triples stream. For the
example I provide there are 'only' three properties and data values. This
is all. If there is anything more then the web service will be overloaded
with parameters and should not work, anything less then the web service
should not work either. I am writing this logic into the application so
that it works under very restrictive conditions and doesn't work for any
other case.


> listObjectsOfProperty(Property) [1] is probably what you want.  Call
> it with hasConveyorProductLoading and you'll get an NodeIterator that
> will return "36.0" to you, and similarly for the other properties and
> their values.
>
> Thank you very much this is exactly what I am after.

Best
Lewis


Obtaining only object's from Model

2013-08-20 Thread Lewis John Mcgibbney
Hi All,
I get a results stream from Fuseki as follows

SPARQL_Rresult.getModel()

for clarity, then I do model.toString() the results stream looks like this

http://www.gilmorekramer.com/more_info/hytrol_ta_conveyor/hytrol_ta_conveyor.shtml.
Data type propoerty associations are made in accordance with the power
calculation methodology located in "ENERGY MANAGEMENT
SERIES 17, FOR INDUSTRY COMMERCE AND INSTITUTIONS, Materials Handling and
On-Site Transportation Equipment, Canada."^^
http://www.w3.org/2001/XMLSchema#string;
mheq:ModelTA_Horizontal_Belt_Conveyor @mheq:hasConveyorProductLoading
"36.0"^^http://www.w3.org/2001/XMLSchema#double;
mheq:ModelTA_Horizontal_Belt_Conveyor @mheq:hasConveyorLength "30.0"^^
http://www.w3.org/2001/XMLSchema#double;
mheq:ModelTA_Horizontal_Belt_Conveyor @mheq:hasConveyorSpeed "0.508"^^
http://www.w3.org/2001/XMLSchema#double;
mheq:ModelTA_Horizontal_Belt_Conveyor @rdf:type mheq:BeltConveyor;
mheq:ModelTA_Horizontal_Belt_Conveyor @rdf:type owl:NamedIndividual} |  [
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#ModelTA_Horizontal_Belt_Conveyor,
http://www.w3.org/2000/01/rdf-schema#comment, "The
ModelTA_Horizontal_Belt_Conveyor individual is a representation of the
product located a
http://www.gilmorekramer.com/more_info/hytrol_ta_conveyor/hytrol_ta_conveyor.shtml.
Data type propoerty associations are made in accordance with the power
calculation methodology located in "ENERGY MANAGEMENT
SERIES 17, FOR INDUSTRY COMMERCE AND INSTITUTIONS, Materials Handling and
On-Site Transportation Equipment, Canada."^^
http://www.w3.org/2001/XMLSchema#string] [
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#ModelTA_Horizontal_Belt_Conveyor,
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#hasConveyorProductLoading,
"36.0"^^http://www.w3.org/2001/XMLSchema#double] [
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#ModelTA_Horizontal_Belt_Conveyor,
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#hasConveyorLength,
"30.0"^^http://www.w3.org/2001/XMLSchema#double] [
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#ModelTA_Horizontal_Belt_Conveyor,
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#hasConveyorSpeed,
"0.508"^^http://www.w3.org/2001/XMLSchema#double] [
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#ModelTA_Horizontal_Belt_Conveyor,
http://www.w3.org/1999/02/22-rdf-syntax-ns#type,
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#BeltConveyor]
[
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#ModelTA_Horizontal_Belt_Conveyor,
http://www.w3.org/1999/02/22-rdf-syntax-ns#type,
http://www.w3.org/2002/07/owl#NamedIndividual]>

what I am interested here is the following

#hasConveyorProductLoading, "36.0"
#hasConveyorLength, "30.0"
#hasConveyorSpeed, "0.508"

I want to use the object data type values as input for an Apache CXF
Webservice.
What I wonder, is what methods I can use from Model [0] or ModelCon [1] to
just get the object values?

Thank you very much
Lewis

[0]
http://jena.apache.org/documentation/javadoc/jena/index.html?com/hp/hpl/jena/rdf/model/Model.html
[1]
http://jena.apache.org/documentation/javadoc/jena/index.html?com/hp/hpl/jena/rdf/model/ModelCon.html

-- 
*Lewis*


Re: Pinpointing Fuseki results stream in Eclipse

2013-08-04 Thread Lewis John Mcgibbney
The magic happens in SPARQL_Query#sendResults(HttpAction action,
SPARQLResult result, Prologue qPrologue)
...
if ( result.isResultSet() )
ResponseResultSet.doResponseResultSet(action,
result.getResultSet(), qPrologue) ;

which eventually leads me to

94: ResponseResultSet#doResponseResultSet$(HttpAction action, ResultSet
resultSet, Boolean booleanResult, Prologue qPrologue)
...
blah blah blah
...
if ( equal(serializationType, WebContent.contentTypeResultsXML) )
sparqlXMLOutput(action, contentType, resultSet, stylesheetURL,
booleanResult) ;
else if ( equal(serializationType,
WebContent.contentTypeResultsJSON) )
jsonOutput(action, contentType, resultSet, booleanResult) ;
else if ( equal(serializationType, WebContent.contentTypeTextPlain)
)
textOutput(action, contentType, resultSet, qPrologue,
booleanResult) ;
else if ( equal(serializationType, WebContent.contentTypeTextCSV) )
csvOutput(action, contentType, resultSet, booleanResult) ;
else if (equal(serializationType, WebContent.contentTypeTextTSV) )
tsvOutput(action, contentType, resultSet, booleanResult) ;
else
errorBadRequest("Can't determine output serialization:
"+serializationType) ;

Right now I'm putting my bets on the resultSet above... which is
subsequently ServletOutputStream object being the golden snitch I am
looking for. It feeds down until I eventually I find

ServletOutputStream out = action.response.getOutputStream() ;

I am hoping that this out object is the one I am after.
It would be nice if it was :0)
Lewis





On Sun, Aug 4, 2013 at 8:17 PM, Lewis John Mcgibbney <
lewis.mcgibb...@gmail.com> wrote:

> Hi,
> I've been jumping in and around jena-fuseki in Eclipse; getting to know it
> a 'bit' better.
> Recent feedback has really helped me to move on with this.
> I've found myself in a scenario where I need to:
> * submit queries to an in memory dataset in Fuseki and get a results stream
> * manipulate the results stream on the server side. An example of this
> would be the following: say I 'know' what will be in the results stream. I
> can pull out elements from the stream and use them for specific tasks. The
> purpose of this is explained next.
> * use individual values from the results stream as input to web
> service(s). Again, it is NOT OK for me to have unknown, inconsistent,
> non-uniform values within the results stream. If I 'know' what is in the
> results stream then my logic for assigning the correct value as the correct
> input for a particular web service works fine.
>
> My current focus is therefore pinpointing which object holds the results
> stream once a query has been submitted and the Fuseki server has done it's
> magic. Right now I'm am assuming I would need to register a new Servlet to
> store and manage the above workflow.
>
> This object which stores the results stream is my priority right now. Can
> anyone help me pin point it please?
>
> Thankyou v much.
> Lewis
>
> --
> *Lewis*
>



-- 
*Lewis*


Pinpointing Fuseki results stream in Eclipse

2013-08-04 Thread Lewis John Mcgibbney
Hi,
I've been jumping in and around jena-fuseki in Eclipse; getting to know it
a 'bit' better.
Recent feedback has really helped me to move on with this.
I've found myself in a scenario where I need to:
* submit queries to an in memory dataset in Fuseki and get a results stream
* manipulate the results stream on the server side. An example of this
would be the following: say I 'know' what will be in the results stream. I
can pull out elements from the stream and use them for specific tasks. The
purpose of this is explained next.
* use individual values from the results stream as input to web service(s).
Again, it is NOT OK for me to have unknown, inconsistent, non-uniform
values within the results stream. If I 'know' what is in the results stream
then my logic for assigning the correct value as the correct input for a
particular web service works fine.

My current focus is therefore pinpointing which object holds the results
stream once a query has been submitted and the Fuseki server has done it's
magic. Right now I'm am assuming I would need to register a new Servlet to
store and manage the above workflow.

This object which stores the results stream is my priority right now. Can
anyone help me pin point it please?

Thankyou v much.
Lewis

-- 
*Lewis*


Re: NPE when submitting query to Jena

2013-08-04 Thread Lewis John Mcgibbney
Quick follow up...
I moved my code to the .tpl file, selected the dataset I wished to use...
and it all works swimmingly (HA HA).
Seriously though, all seems to be good and I am getting much better results.
Thanks


On Sun, Aug 4, 2013 at 6:25 PM, Lewis John Mcgibbney <
lewis.mcgibb...@gmail.com> wrote:

> Hi Andy,
>
> On Fri, Aug 2, 2013 at 3:25 AM, Andy Seaborne  wrote:
>
>> https://issues.apache.org/**jira/browse/JENA-497<https://issues.apache.org/jira/browse/JENA-497>
>>
>
> You've hit the nail right on the head here.
>
>
>>
>> The issue is that you are using sparql.html -- "General SPARQL Service"
>> on the front page.
>>
>
> Yes, this is the form that I have amended to pull my front end together. I
> drag and drop queries... which is all working quite nicely.
>
>
>> It is a form to send a query to the server which is not associated with
>> any datasets.
>
>
> And this causes the NPE.
>
>
>> You have to use "Target graph URI" or put FROM NAMED? in query and the
>> server will load the data for that query only.
>>
>
> OK so using the *sparql.tpl* form I write the following query
>
>
> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX mheq: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#
> >
> DESCRIBE ?individual
> FROM NAMED 
>
> WHERE {
>  ?individual rdf:type mheq:BeltConveyor.
> }
>
> Which works fine, I get my results.
>
> @prefix :  <http://www.owl-ontologies.com/Ontology1357168977.owl#> .
> @prefix protege: <http://protege.stanford.edu/plugins/owl/protege#> .
> @prefix RemoteI: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#RemoteI/>
> .
> @prefix xsp:   <http://www.owl-ontologies.com/2005/08/07/xsp.owl#> .
> @prefix LR_Mate_200iB-200iB: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#LR_Mate_200iB-200iB/3>
> .
> @prefix mheq:  <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#>
> .
> @prefix AssemblyProcess: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/AssemblyProcess.owl#>
> .
> @prefix I: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#I/>
> .
> @prefix MaterialHandlingEquipment: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#>
> .
> @prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
> @prefix swrl:  <http://www.w3.org/2003/11/swrl#> .
> @prefix JoiningProcess: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/JoiningProcess.owl#>
> .
> @prefix swrlb: <http://www.w3.org/2003/11/swrlb#> .
> @prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
> @prefix owl:   <http://www.w3.org/2002/07/owl#> .
> @prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>
> MaterialHandlingEquipment:ModelTA_Horizontal_Belt_Conveyor
> a owl:NamedIndividual ,
> MaterialHandlingEquipment:BeltConveyor ;
> rdfs:comment  "The ModelTA_Horizontal_Belt_Conveyor individual is
> a representation of the product located a
> http://www.gilmorekramer.com/more_info/hytrol_ta_conveyor/hytrol_ta_conveyor.shtml.
> Data type propoerty associations are made in accordance with the power
> calculation methodology located in \"ENERGY MANAGEMENT\nSERIES 17, FOR
> INDUSTRY COMMERCE AND INSTITUTIONS, Materials Handling and On-Site
> Transportation Equipment, Canada."^^xsd:string ;
> MaterialHandlingEquipment:hasCentreToCentreDistanceBetweenRollers
> "0.0"^^xsd:double ;
> MaterialHandlingEquipment:hasCoefficientOfFriction
> "0.3"^^xsd:double ;
> MaterialHandlingEquipment:hasConveyorAngleOfIncline
> "20.0"^^xsd:double ;
> MaterialHandlingEquipment:hasConveyorLength
> "30.0"^^xsd:double ;
> MaterialHandlingEquipment:hasConveyorProductLoading
> "36.0"^^xsd:double ;
> MaterialHandlingEquipment:hasConveyorSpeed
> "0.508"^^xsd:double ;
> MaterialHandlingEquipment:hasConveyorWidthBetweenFrames
> "0.84"^^xsd:double .
>
> I cannot achieve these results from the *sparql.html* form though even
> though I specify FROM NAMED in my query. I still get the NPE.
> The problem is that I do not know that syntax for the Target Graph URI
> e.g. http://localhost:3030/susman/data?graph=...
>
> *susman is the in memory dataset I used when I started the Fuseki server
> - ./fuseki-server --update --mem /susman
>
> I am nearly there with this one. Some last guidance would be really
> appreciated.
> Thank you so much.
> Lewis
>
>


-- 
*Lewis*


Re: Backing code for Fuseki *.html

2013-08-04 Thread Lewis John Mcgibbney
Stepping through this was very very helpful.
Thanks Claude.
Lewis


On Thu, Aug 1, 2013 at 11:37 PM, Claude Warren  wrote:

> Lewis,
>
> It has been awhile since I was in this part of the code base but
>
> in the tpl you will find:
>
> [snip]
> #set( $ds = $mgt.dataset($request, "") )
> #set( $srvQuery = $mgt.serviceQuery($ds) )
> [snip]
>
> accept-charset="UTF-8">
> [snip]
>
> so when the form is submitted it will call whatever the dataset
> serviceQuery url is.
>
> The SPARQLServer.java contains the code that configures the server.
>  Without knowing what changes you have made to your configuration the rest
> of this gets a bit difficult, but I will attempt to follow the standard
> flow.
>
> in org.apache.jena.fuseki.server.SPARQLServer.builderServer() at approx
> line 238 (I'm looking at v 2.10.2-SNAPSHOT)
>
> [snip]
>  if ( installManager || installServices ) {
> // TODO Respect port.
> if ( serverConfig.pagesPort != serverConfig.port )
> serverLog.warn("Not supported yet - pages on a different
> port to services") ;
>
> String base = serverConfig.pages ;
> Map data = new HashMap() ;
> data.put("mgt", new MgtFunctions()) ;
> SimpleVelocityServlet templateEngine = new
> SimpleVelocityServlet(base, data) ;
> addServlet(context, templateEngine, "*.tpl", false) ;
> }
> [snip]
>
> This codes provides the mgt variable ($mgt above) in the tpl file.
> All *.tpl flow through the templateEngine servlet.
>
> At line approx line 320 you will find
>
> [snip]
> HttpServlet sparqlQuery = new SPARQL_QueryDataset() ;
> HttpServlet sparqlUpdate = new SPARQL_Update() ;
> HttpServlet sparqlUpload = new SPARQL_Upload() ;
> HttpServlet sparqlHttpR = new SPARQL_REST_R() ;
> HttpServlet sparqlHttpRW = new SPARQL_REST_RW() ;
> HttpServlet sparqlDataset = new SPARQL_UberServlet.AccessByConfig()
> ;
>
> if ( !überServlet ) {
> // If uberserver, these are unnecessary but can be used.
> // If just means the überservlet isn't handling these
> operations.
> addServlet(context, datasetPath, sparqlQuery, dsDesc.query,
> enableCompression) ;
> addServlet(context, datasetPath, sparqlUpdate, dsDesc.update,
> false) ;
> addServlet(context, datasetPath, sparqlUpload, dsDesc.upload,
> false) ; // No point - no results of any size.
> addServlet(context, datasetPath, sparqlHttpR,
> dsDesc.readGraphStore, enableCompression) ;
> addServlet(context, datasetPath, sparqlHttpRW,
> dsDesc.readWriteGraphStore, enableCompression) ;
> // This adds direct operations on the dataset itself.
> // addServlet(context, datasetPath, sparqlDataset,
> // ListOfEmptyString, enableCompression) ;
> } else {
>  [snip]
>
> This is where the sparqlQuery servlet is registered to handle the general
> /{dataset}/sparql endpoint.
>
> in org.apache.jena.fuseki.servlets.SPARQL_QueryDataset at approx line 44 is
> the method decideDataset().  That method should be called when fuseki
> attempts to match the query with the dataset you want to query.  A
> breakpoint in that method should get you into the code that is executing.
>
> Hope this helps,
> Claude
>
>
> On Fri, Aug 2, 2013 at 12:58 AM, Lewis John Mcgibbney <
> lewis.mcgibb...@gmail.com> wrote:
>
> > Hi Andy,
> > On Wed, Jul 24, 2013 at 12:32 AM, Andy Seaborne  wrote:
> >
> > >
> > > Also I've never worked with .tpl files before... they look similar but
> I
> > am
> > >> not familiar...
> > >>
> > >
> > > .tpl files are Velocity files.  I decided to hide the technology used
> by
> > > calling them "tpl" not "vm" in case it changes.
> > >
> > >
> >
> > I have the feeling that I need to edit the velocity file (.tpl) as well
> as
> > the .html if I want to add modify the query form.
> > Can you confirm if this is the case.
> > I am trying to follow my query through from form submission to execution
> of
> > the Java code within the Fuseki servlets... right now this is not
> happening
> > for me.
> > Any guidance on how I can get dug in here would be great.
> > It would also make my life that little bit easier... oh and my upcoming
> > weekend (what weekend!!!) that little bit easier :0)
> > Thank you v much.
> > Lewis
> >
>
>
>
> --
> I like: Like Like - The likeliest place on the web<
> http://like-like.xenei.com>
> Identity: https://www.identify.nu/user.php?cla...@xenei.com
> LinkedIn: http://www.linkedin.com/in/claudewarren
>



-- 
*Lewis*


Re: NPE when submitting query to Jena

2013-08-04 Thread Lewis John Mcgibbney
Hi Andy,

On Fri, Aug 2, 2013 at 3:25 AM, Andy Seaborne  wrote:

> https://issues.apache.org/**jira/browse/JENA-497
>

You've hit the nail right on the head here.


>
> The issue is that you are using sparql.html -- "General SPARQL Service" on
> the front page.
>

Yes, this is the form that I have amended to pull my front end together. I
drag and drop queries... which is all working quite nicely.


> It is a form to send a query to the server which is not associated with
> any datasets.


And this causes the NPE.


> You have to use "Target graph URI" or put FROM NAMED? in query and the
> server will load the data for that query only.
>

OK so using the *sparql.tpl* form I write the following query

PREFIX rdf: 
PREFIX mheq: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#
>
DESCRIBE ?individual
FROM NAMED 
WHERE {
 ?individual rdf:type mheq:BeltConveyor.
}

Which works fine, I get my results.

@prefix :   .
@prefix protege:  .
@prefix RemoteI: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#RemoteI/>
.
@prefix xsp:    .
@prefix LR_Mate_200iB-200iB: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#LR_Mate_200iB-200iB/3>
.
@prefix mheq:  <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#>
.
@prefix AssemblyProcess: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/AssemblyProcess.owl#>
.
@prefix I: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#I/>
.
@prefix MaterialHandlingEquipment: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#>
.
@prefix rdfs:   .
@prefix swrl:   .
@prefix JoiningProcess: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/JoiningProcess.owl#>
.
@prefix swrlb:  .
@prefix xsd:    .
@prefix owl:    .
@prefix rdf:    .

MaterialHandlingEquipment:ModelTA_Horizontal_Belt_Conveyor
a owl:NamedIndividual ,
MaterialHandlingEquipment:BeltConveyor ;
rdfs:comment  "The ModelTA_Horizontal_Belt_Conveyor individual is a
representation of the product located a
http://www.gilmorekramer.com/more_info/hytrol_ta_conveyor/hytrol_ta_conveyor.shtml.
Data type propoerty associations are made in accordance with the power
calculation methodology located in \"ENERGY MANAGEMENT\nSERIES 17, FOR
INDUSTRY COMMERCE AND INSTITUTIONS, Materials Handling and On-Site
Transportation Equipment, Canada."^^xsd:string ;
MaterialHandlingEquipment:hasCentreToCentreDistanceBetweenRollers
"0.0"^^xsd:double ;
MaterialHandlingEquipment:hasCoefficientOfFriction
"0.3"^^xsd:double ;
MaterialHandlingEquipment:hasConveyorAngleOfIncline
"20.0"^^xsd:double ;
MaterialHandlingEquipment:hasConveyorLength
"30.0"^^xsd:double ;
MaterialHandlingEquipment:hasConveyorProductLoading
"36.0"^^xsd:double ;
MaterialHandlingEquipment:hasConveyorSpeed
"0.508"^^xsd:double ;
MaterialHandlingEquipment:hasConveyorWidthBetweenFrames
"0.84"^^xsd:double .

I cannot achieve these results from the *sparql.html* form though even
though I specify FROM NAMED in my query. I still get the NPE.
The problem is that I do not know that syntax for the Target Graph URI e.g.
http://localhost:3030/susman/data?graph=...

*susman is the in memory dataset I used when I started the Fuseki server  -
./fuseki-server --update --mem /susman

I am nearly there with this one. Some last guidance would be really
appreciated.
Thank you so much.
Lewis


Re: Backing code for Fuseki *.html

2013-08-02 Thread Lewis John Mcgibbney
Hi Claude,
Thank you v much for taking time to source and explain this through to me.
It is pretty late and I am going to pick it up tomorrow.
I'll most likely post back then.
Thanks
Lewis

On Thursday, August 1, 2013, Claude Warren  wrote:
> Lewis,
>
> It has been awhile since I was in this part of the code base but
>
> in the tpl you will find:
>
> [snip]
> #set( $ds = $mgt.dataset($request, "") )
> #set( $srvQuery = $mgt.serviceQuery($ds) )
> [snip]
>
>   
> [snip]
>
> so when the form is submitted it will call whatever the dataset
> serviceQuery url is.
>
> The SPARQLServer.java contains the code that configures the server.
>  Without knowing what changes you have made to your configuration the rest
> of this gets a bit difficult, but I will attempt to follow the standard
> flow.
>
> in org.apache.jena.fuseki.server.SPARQLServer.builderServer() at approx
> line 238 (I'm looking at v 2.10.2-SNAPSHOT)
>
> [snip]
>  if ( installManager || installServices ) {
> // TODO Respect port.
> if ( serverConfig.pagesPort != serverConfig.port )
> serverLog.warn("Not supported yet - pages on a different
> port to services") ;
>
> String base = serverConfig.pages ;
> Map data = new HashMap() ;
> data.put("mgt", new MgtFunctions()) ;
> SimpleVelocityServlet templateEngine = new
> SimpleVelocityServlet(base, data) ;
> addServlet(context, templateEngine, "*.tpl", false) ;
> }
> [snip]
>
> This codes provides the mgt variable ($mgt above) in the tpl file.
> All *.tpl flow through the templateEngine servlet.
>
> At line approx line 320 you will find
>
> [snip]
> HttpServlet sparqlQuery = new SPARQL_QueryDataset() ;
> HttpServlet sparqlUpdate = new SPARQL_Update() ;
> HttpServlet sparqlUpload = new SPARQL_Upload() ;
> HttpServlet sparqlHttpR = new SPARQL_REST_R() ;
> HttpServlet sparqlHttpRW = new SPARQL_REST_RW() ;
> HttpServlet sparqlDataset = new
SPARQL_UberServlet.AccessByConfig()
> ;
>
> if ( !überServlet ) {
> // If uberserver, these are unnecessary but can be used.
> // If just means the überservlet isn't handling these
> operations.
> addServlet(context, datasetPath, sparqlQuery, dsDesc.query,
> enableCompression) ;
> addServlet(context, datasetPath, sparqlUpdate, dsDesc.update,
> false) ;
> addServlet(context, datasetPath, sparqlUpload, dsDesc.upload,
> false) ; // No point - no results of any size.
> addServlet(context, datasetPath, sparqlHttpR,
> dsDesc.readGraphStore, enableCompression) ;
> addServlet(context, datasetPath, sparqlHttpRW,
> dsDesc.readWriteGraphStore, enableCompression) ;
> // This adds direct operations on the dataset itself.
> // addServlet(context, datasetPath, sparqlDataset,
> // ListOfEmptyString, enableCompression) ;
> } else {
>  [snip]
>
> This is where the sparqlQuery servlet is registered to handle the general
> /{dataset}/sparql endpoint.
>
> in org.apache.jena.fuseki.servlets.SPARQL_QueryDataset at approx line 44
is
> the method decideDataset().  That method should be called when fuseki
> attempts to match the query with the dataset you want to query.  A
> breakpoint in that method should get you into the code that is executing.
>
> Hope this helps,
> Claude
>
>
> On Fri, Aug 2, 2013 at 12:58 AM, Lewis John Mcgibbney <
> lewis.mcgibb...@gmail.com> wrote:
>
>> Hi Andy,
>> On Wed, Jul 24, 2013 at 12:32 AM, Andy Seaborne  wrote:
>>
>> >
>> > Also I've never worked with .tpl files before... they look similar but
I
>> am
>> >> not familiar...
>> >>
>> >
>> > .tpl files are Velocity files.  I decided to hide the technology used
by
>> > calling them "tpl" not "vm" in case it changes.
>> >
>> >
>>
>> I have the feeling that I need to edit the velocity file (.tpl) as well
as
>> the .html if I want to add modify the query form.
>> Can you confirm if this is the case.
>> I am trying to follow my query through from form submission to execution
of
>> the Java code within the Fuseki servlets... right now this is not
happening
>> for me.
>> Any guidance on how I can get dug in here would be great.
>> It would also make my life that little bit easier... oh and my upcoming
>> weekend (what weekend!!!) that little bit easier :0)
>> Thank you v much.
>> Lewis
>>
>
>
>
> --
> I like: Like Like - The likeliest place on the web<
http://like-like.xenei.com>
> Identity: https://www.identify.nu/user.php?cla...@xenei.com
> LinkedIn: http://www.linkedin.com/in/claudewarren
>

-- 
*Lewis*


Re: Backing code for Fuseki *.html

2013-08-01 Thread Lewis John Mcgibbney
Hi Andy,
On Wed, Jul 24, 2013 at 12:32 AM, Andy Seaborne  wrote:

>
> Also I've never worked with .tpl files before... they look similar but I am
>> not familiar...
>>
>
> .tpl files are Velocity files.  I decided to hide the technology used by
> calling them "tpl" not "vm" in case it changes.
>
>

I have the feeling that I need to edit the velocity file (.tpl) as well as
the .html if I want to add modify the query form.
Can you confirm if this is the case.
I am trying to follow my query through from form submission to execution of
the Java code within the Fuseki servlets... right now this is not happening
for me.
Any guidance on how I can get dug in here would be great.
It would also make my life that little bit easier... oh and my upcoming
weekend (what weekend!!!) that little bit easier :0)
Thank you v much.
Lewis


NPE when submitting query to Jena

2013-08-01 Thread Lewis John Mcgibbney
Hi,
For an in house R&D project, I've recently been working with adding some
functionality to the Fuseki UI.

First I start the server

law@lawx:~/Downloads/Lewis/code/essem-fuseki/target/essem-fuseki-0.2.8-SNAPSHOT$
./fuseki-server --update --mem /susman
14:15:45 INFO  Server   :: Dataset: in-memory
14:15:45 INFO  Config   :: Home Directory:
/home/law/Downloads/Lewis/code/essem-fuseki/target/essem-fuseki-0.2.8-SNAPSHOT
14:15:45 INFO  Server   :: Dataset path = /susman
14:15:45 INFO  Server   :: Fuseki 0.2.8-SNAPSHOT
2013-08-01T14:15:02-0700
14:15:45 INFO  Server   :: Started 2013/08/01 14:15:45 PDT on
port 3030

Then I manually upload some triples from four different OWL files

14:16:27 INFO  Fuseki   :: [1] POST
http://localhost:3030/susman/upload
14:16:27 INFO  Fuseki   :: [1] Upload: Filename:
AssemblyProcess.owl, Content-Type=text/xml, Charset=null => RDF/XML
14:16:27 INFO  Fuseki   :: [1] Upload: Filename:
AutomobileManufacturing.owl, Content-Type=text/xml, Charset=null => RDF/XML
14:16:27 INFO  Fuseki   :: [1] Upload: Filename:
JoiningProcess.owl, Content-Type=text/xml, Charset=null => RDF/XML
14:16:27 INFO  Fuseki   :: [1] Upload: Filename:
MaterialHandlingEquipment.owl, Content-Type=text/xml, Charset=null =>
RDF/XML
14:16:27 INFO  Fuseki   :: [1] Upload: Graph: default (1148
triple(s))
14:16:27 INFO  Fuseki   :: [1] 200 OK (306 ms)

But I am experiencing a real nasty issue when I attempt to execute a query
via the "Get Results" button. My query is as follows

PREFIX rdf: 
PREFIX mheq: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#
>
DESCRIBE ?individual
WHERE {
 ?individual rdf:type mheq:BeltConveyor.
}

I get the following

14:16:44 INFO  Fuseki   :: [2] GET
http://localhost:3030/sparql?query=PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+mheq%3A+%3Chttp%3A%2F%2Feil.stanford.edu%3A443%2Fsvn%2Feil-repo%2FUsers%2FLewis%2Fontology%2FMaterialHandlingEquipment.owl%23%3E%0D%0ADESCRIBE+%3Findividual%0D%0AWHERE+%7B%0D%0A+%3Findividual+rdf%3Atype+mheq%3ABeltConveyor.++%0D%0A%7D++&default-graph-uri=&output=json&stylesheet=%2Fxml-to-html.xsl
14:16:44 WARN  Fuseki   :: [2] RC = 500 : null
java.lang.NullPointerException
at
org.apache.jena.fuseki.servlets.SPARQL_ServletBase.mapRequestToService(SPARQL_ServletBase.java:311)
at
org.apache.jena.fuseki.servlets.SPARQL_ServletBase.execCommonWorker(SPARQL_ServletBase.java:153)
at
org.apache.jena.fuseki.servlets.SPARQL_ServletBase.doCommon(SPARQL_ServletBase.java:78)
at
org.apache.jena.fuseki.servlets.SPARQL_Query.doGet(SPARQL_Query.java:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448)
at
org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:82)
at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:294)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at
org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
at
org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at
org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
at
org.eclipse.jetty.server.nio.BlockingChannelConnector$BlockingChannelEndPoint.run(BlockingChannelConnector.java:298)
at
org.eclipse.jetty.util.thread.QueuedTh

Re: Backing code for Fuseki *.html

2013-07-24 Thread Lewis John Mcgibbney
Thank you very much Andy.
As always, thank you.
Best
Lewis


On Wed, Jul 24, 2013 at 12:32 AM, Andy Seaborne  wrote:

> On 24/07/13 02:36, Lewis John Mcgibbney wrote:
>
>> Hi All,
>> I'm utilizing the Fuseki source [0] to build an application enabling
>> access
>> to my triples data.
>> Can someone please explain to me how queries are sent to the server
>> please?
>>
>
> SPARQL protocol.
>
> http://www.w3.org/TR/sparql11-**protocol/<http://www.w3.org/TR/sparql11-protocol/>
>
> which can be driven from an HTML form.
>
> GET /yourendpoint?query=**encodedQuery
>
>
>  Looking at the source in sparql.html [1] I am struggling to see what code
>> is called to initiative queries?
>>
>
> 
> ...
>   
> ...
> 
>
> causes "GET /sparql?query=..." to be sent.
>
> See also SOH:
> http://jena.apache.org/**documentation/serving_data/**
> index.html#sparql-over-http<http://jena.apache.org/documentation/serving_data/index.html#sparql-over-http>
>
> and jeva library code in ARQ.
>
>
>  Can someone please explain this to me please?
>> Also I've never worked with .tpl files before... they look similar but I
>> am
>> not familiar...
>>
>
> .tpl files are Velocity files.  I decided to hide the technology used by
> calling them "tpl" not "vm" in case it changes.
>
> Andy
>
>
>  Thank you very much in advance.
>> Best
>> Lewis
>>
>> [0] 
>> http://svn.apache.org/repos/**asf/jena/trunk/jena-fuseki/<http://svn.apache.org/repos/asf/jena/trunk/jena-fuseki/>
>> [1] http://svn.apache.org/repos/**asf/jena/trunk/jena-fuseki/**
>> pages/sparql.html<http://svn.apache.org/repos/asf/jena/trunk/jena-fuseki/pages/sparql.html>
>>
>>
>


-- 
*Lewis*


Backing code for Fuseki *.html

2013-07-23 Thread Lewis John Mcgibbney
Hi All,
I'm utilizing the Fuseki source [0] to build an application enabling access
to my triples data.
Can someone please explain to me how queries are sent to the server please?
Looking at the source in sparql.html [1] I am struggling to see what code
is called to initiative queries?
Can someone please explain this to me please?
Also I've never worked with .tpl files before... they look similar but I am
not familiar...
Thank you very much in advance.
Best
Lewis

[0] http://svn.apache.org/repos/asf/jena/trunk/jena-fuseki/
[1] http://svn.apache.org/repos/asf/jena/trunk/jena-fuseki/pages/sparql.html
-- 
*Lewis*


Re: Using Fuseki API

2013-07-02 Thread Lewis John Mcgibbney
Hi Andy,
Thanks for the feedback.

On Tue, Jul 2, 2013 at 3:38 AM, Andy Seaborne  wrote:

> Hi Lewis - you want to push a bytestream?  And you know the content type?
>

Yeah I have a ByteStream. As I'm working with Any23 we can have different
contentTypes... but for now I've turned to the dark side and I am working
with RDF/XML.


>
> Fuseki is a server - most people run it like you are as a complete server.
> The "API" is HTTP :-)  Or the API is SPARQL (protocol for query/update and
> also GSP (Graph SPARQL Store Protocol).
>

Get you. So @application layer I should just be making HTTP calls.


>
> There are some helper classes that might help but they going to end up
> pulling in Jena (and Any23 is sesame-based).  So for example,
> DatasetAccessor is a graph put/get interface to a Dataset with GSP-like
> operations.
>

Thanks for the reference. I'll check this out... but I have a feeling it is
too much for me use case. You never know. Hopefully I can learn something
new here as well.

>
> The instance is the URL for the server endpoint.
>

OK Doke.


>
> What you want to do is POST the bytes (content-type) to the GSP endpoint,
> usually 
> http://HOST:3030/dataset/data?**defaultor
> http://HOST:3030/dataset/data?**graph=encodedURI
> .
>
> You can do that with whatever networking code you like so you don't need
> to pull in Jena just for that.
>
> There is some helper code (mostly Jena independent) in HttpOp.execHttpPost
> which is a wrapping up of use of Apache HTTP Client.
>
> Actually, HttpOp's main role is to centralize Jena's use of HTTP for
> common logging and common functionality.
>
> As that comes down to about 20 lines of Apache HTTP Client driver code,
> you're probably better using it as an example.
>
> Or use plain old java.net - no extra dependencies.
>
>

Thanks Andy.
Lewis
-- 
*Lewis*


Using Fuseki API

2013-07-01 Thread Lewis John Mcgibbney
Hi,
I am slightly confused as to what API I should be using to do the following.
I have triples data (from an Any23 pipeline) in a Java
ByteArrayOutputStream.
I want to write them in to a standalone Fuseki server which is already
running and we can assume will always be running in my data centre. I would
like to run my code and just push triples in to Fuseki for the time being.
Another application plays with querying and getting them out... which I am
working on elsewhere (sigh ;))
Should I be using the Fuseki API [0] for this? I lodged JENA-483 as I
intend to document everything I discover over the next while and put it in
to trunk.

How do I get hold of an instance of a server which is already running?
I never need to call fuseki.init(), or use DatasetAccessorFactory or
anything like that, all I want to do is push data through my pipeline to a
running Fuseki instance.

Thank you for any directions.
Best

[0] http://jena.apache.org/documentation/javadoc/fuseki/index.html

-- 
*Lewis*


Re: Locating and manipulating a resource (triples) stream

2013-05-20 Thread Lewis John Mcgibbney
Hi,
Having come back to this tonight, I think I am slightly closer :0)
I *think* the code I am after is located in jena-arq around here [0]
Specifically, I found the ResultSetFormatter [1], this beast looks exactly
like what I am after.
Lewis

[0]
http://svn.apache.org/repos/asf/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/
[1]
http://jena.apache.org/documentation/javadoc/arq/index.html?com/hp/hpl/jena/query/ResultSetFormatter.html


On Mon, May 20, 2013 at 1:11 PM, Lewis John Mcgibbney <
lewis.mcgibb...@gmail.com> wrote:

> Hi All,
> Say I submit a DESCRIBE query (via Fuseki for instance) and my query
> matches one subject which has many resources, all of which is returned as a
> stream, I would like to locate the code within Jena that actually
> represents this stream.
> My reasoning behind this is that I wish to manipulate the data stream (of
> possible) and extract specific parts of data, using them as input to drive
> web services deployed in Axis2.
> I do not know the Jena codebase intimately therefore I thought it best to
> write here in an attempt to get the info from one of you guys!
> Thank you very much in advance for anyone able to help me out.
> Best
> Lewis
>
> --
> *Lewis*
>



-- 
*Lewis*


Locating and manipulating a resource (triples) stream

2013-05-20 Thread Lewis John Mcgibbney
Hi All,
Say I submit a DESCRIBE query (via Fuseki for instance) and my query
matches one subject which has many resources, all of which is returned as a
stream, I would like to locate the code within Jena that actually
represents this stream.
My reasoning behind this is that I wish to manipulate the data stream (of
possible) and extract specific parts of data, using them as input to drive
web services deployed in Axis2.
I do not know the Jena codebase intimately therefore I thought it best to
write here in an attempt to get the info from one of you guys!
Thank you very much in advance for anyone able to help me out.
Best
Lewis

-- 
*Lewis*


Locating and manipulating results (triples) stream

2013-05-20 Thread Lewis John Mcgibbney
Hi,
I need to

-- 
*Lewis*


Getting to know my data in Fuseki

2013-03-05 Thread Lewis John Mcgibbney
Hi,
Say I s-put a bunch of OWL files in to my Fuseki server in memory, all goes
well. Over time, I may wish to add more, update the files... the usual SOH
stuff.
Is there any mechanism to actually understand how the underlying data us
structured?
For example within the control panel, it would be nice to know at least how
many documents (within the Fuski server) I can do operations on.
Currently I really need to know the data semantics before I can execute my
queries... and unfortunately this is not always the case.
I may have a fuseki server running for a while... I go off and work on
other things then come back to it, I would like to refresh my own memory as
to what is actually in Fuseki.
Is something like this possible?
Thank you very much
Lewis


-- 
*Lewis*


Re: Upgrading Jena Dependencies

2013-01-16 Thread Lewis John Mcgibbney
Hi Andy,

Dynamite, this is correct.
Thank you very much for the heads up.
Have a great evening.
Best
Lewis

On Wed, Jan 16, 2013 at 2:43 PM, Andy Seaborne  wrote:

> On 16/01/13 22:35, Lewis John Mcgibbney wrote:
>
>> Hi,
>>
>> I've taken on a (rather dated) project which has the following jars
>> physically stored within.
>>
>> -arq.jar
>> -arq-extra.jar
>> -iri.jar
>> -jena.jar
>> -virt_jena.jar
>> -virtjdbc3.jar
>>
>> It should be noted that all compiled classes (inside the jar's) follow the
>> 'com.hpl.blah.blah' package naming mechanism.
>>
>> I'm in the process of upgrading the artifacts (and actually putting Maven
>> in place to manage them) however I wonder if someone can fill me in on the
>> following
>>
>> 1) What happened to arq-extra, was it integrated into jena-arq?
>>
>
> Yes.
>
>
>  2) What is virt_jena?... if anyone knows.
>>
>
> Openlink Virtuso - not part of Jena.
>
>
>  3) Was virtjdbc3.jar ever a part of Jena?
>>
>
> Openlink Virtuso JDBC driver
> Not part of Jena.
>
>
>
>> Thank you very much in advance.
>>
>> Kind Regards
>> Lewis
>>
>>
>


-- 
*Lewis*


Upgrading Jena Dependencies

2013-01-16 Thread Lewis John Mcgibbney
Hi,

I've taken on a (rather dated) project which has the following jars
physically stored within.

-arq.jar
-arq-extra.jar
-iri.jar
-jena.jar
-virt_jena.jar
-virtjdbc3.jar

It should be noted that all compiled classes (inside the jar's) follow the
'com.hpl.blah.blah' package naming mechanism.

I'm in the process of upgrading the artifacts (and actually putting Maven
in place to manage them) however I wonder if someone can fill me in on the
following

1) What happened to arq-extra, was it integrated into jena-arq?
2) What is virt_jena?... if anyone knows.
3) Was virtjdbc3.jar ever a part of Jena?

Thank you very much in advance.

Kind Regards
Lewis
-- 
*Lewis*


Re: Any23 in Jena

2012-11-05 Thread Lewis John Mcgibbney
Hi Andy,

On Mon, Nov 5, 2012 at 9:37 PM, Andy Seaborne  wrote:
>
> "drink our own champagne"

Certainly a slight improvement, however today has been long and its
too late for me to take this any further... just now :0)

>
> ARP parses RDF/XML [A] -- RDF/XML in, triples out -- similar to Any23
> RDFXMLExtractor (via rio).
>

And in your opinion (knowing most certainly the ARP and most probably
the Any23 stuff inside out)... what are the areas one would target
(within the Jena API) to pull/combine the best bits of the code or
alternatively implement a re-design of the Jena ARP API to run ontop
of the Any23 parsing and extraction packages?

Am I flogging a dead horse or is the reason that this has not been
addressed simply because it works and why change what isn't broken?

Lewis


Using TDB to Compliment MarkLogic

2012-11-05 Thread Lewis John Mcgibbney
Hi All,

Currently I have a stack of XML documents in MarkLogic. They get there
via an XProc pipeline. I am currently working to run Apache Any23 on
the XML *just* before it get inserted into MarkLogic. I would like to
then send the extracted structure e.g. triples, etc to TDB and use
this structure to compliment structured or text based queries within
my search application.

Currently I need clarification on a couple of areas if possible...

1. The triples can be easily extracted then written as a
ByteArrayOutputStream (or a Sting representation of this Stream), and
I assume this can be fed into TDB?

2. If this above is achievable... how exactly would TDB persist the
Stream? Would this be one graph? Can someone please expand on this?

3. How would I synchronize the XML documents and the associated
content within TDB? This is my major area of confusion. I accept that
this is not in any way, shape or form related to TDB/Jena... but I am
curious to hear from anyone out there who has attempted anything
similar.

The idea is to compliment structured or text based queries into a
search application and have the relevant TDB content compliment the
users search... something like the provision of domain/document
specific metadata to give more body to the search experience.

Thanks very much for any feedback on this one, I realise it is a
pretty lengthy question but any suggestions would be great.

All the best

Lewis

-- 
Lewis


Re: Correct SPARQL query for all information for particular Individual

2012-06-26 Thread Lewis John Mcgibbney
Hi Andy,

On Tue, Jun 26, 2012 at 6:35 PM, Andy Seaborne  wrote:
> I don't "do" RDF/XML :-) but this may achieve what you want.

That makes two of us then!!!

>
> PREFIX 
> DESCRIBE ?x { ?x IFC2X3_subset:hasName IFC2X3_subset:IfcBeam }
>
> The default for DESCRIBE is the bNode closure.
>
> If you know the structure, then you can use CONSTRUCT or extract into
> variables with SELECT.
>
>        Andy

This gives me something great to work on thank you very much.

Lewis


Correct SPARQL query for all information for particular Individual

2012-06-26 Thread Lewis John Mcgibbney
Hi Everyone,
Having produced a subset of a rather large ontology I'm now attempting
to write a SPARQL query to retrieve all attributes of any given
individuals if the name matches. An example of one of my
NamedIndividuals is below
















IfcBeam
ifc:IfcBuildingElement
true




Now say my query matched the rdf:About="" and the
IFC2X3_subset:hasName rdf:resource="&IFC2X3_subset;IfcBeam"  out of
all of the individuals I have persisted, I would like all the
information above to be returned within the response...

Any help would be greatly appreciated.

Thank you very much in advance
Lewis

-- 
Lewis


Re: Best way to produce Ontology from XSD

2012-06-11 Thread Lewis John Mcgibbney
Hi Milorad,

Apologies for not getting back to you I previously sent my message
from my apache email address, which was kindly accepted by the list
moderator (Andy) I am now subscribed.

The project is part of my ongoing PhD research work. I am interested
in modeling data from the domain of sustainable design and
construction as linked data/RDF/OWL etc. hence the reason for the
inquiry relating to ontology construction and vocabulary choice.

Best

Lewis

-- 
Lewis


Best way to produce Ontology from XSD

2012-06-09 Thread lewis john mcgibbney
Goof Afternoon Everyone,

I'm in a bit of a puzzle just now w.r.t producing a suitable ontology
from a XSD which I have at the link below (all other configuration is
in the parent directory)

http://www.buildingsmart-tech.org/ifcXML/IFC2x3/FINAL/IFC2X3.xsd

Basically the schema describes all sorts of construction and
engineering elements such as windows, walls, doors, etc etc.
I want to build an RDF or OWL resource which uses appropriate
vocabularies to describe these elements and their various attributes.

So if I pick one element e.g











This describes an element with the name IfcWall (a typical wall) which
belongs to the ifc:IfcBuildingElement substitutionGroup and has X Y Z
properties

My idea is to use XSLT to grab all of the elements I wish to include
within the ontology (a subset), then begin modeling each element in
RDF/OWL however I'm unsure on
1) which vocabularies exist for correctly describing the relationships
(http://www.w3.org/TR/owl-features/)
2) How to do this in a consistent manner between elements
3) If such a task can be (semi)automated

Basically I need some help with the data modeling aspect of the work.

Any direction/information would be greatly appreciated.

Kind Regards and thanks in advance for any help

Lewis