Checking whether object is rdf:XMLLiteral

2015-05-26 Thread Martynas Jusevičius
Hey, is there a better way than import com.hp.hpl.jena.datatypes.xsd.impl.XMLLiteralType; ... if (!stmt.getObject().isLiteral() || !stmt.getLiteral().getDatatype().equals(XMLLiteralType.theXMLLiteralType)) ? Thanks, Martynas graphityhq.com

Re: Checking whether object is rdf:XMLLiteral

2015-05-26 Thread Martynas Jusevičius
Thanks. That does not seem to be available in Jena 2.11.0 though. On Tue, May 26, 2015 at 10:56 PM, Andy Seaborne a...@apache.org wrote: On 26/05/15 15:38, Martynas Jusevičius wrote: Hey, is there a better way than import com.hp.hpl.jena.datatypes.xsd.impl.XMLLiteralType

Re: AW: Fuseki2 - how to customize example queries?

2015-05-24 Thread Martynas Jusevičius
Joachim, you could try our Graphity Processor which does what I think you need: it enables declarative configuration of SPARQL queries for different Linked Data URI paths. Please take a look here: http://graphityhq.com/technology/graphity-processor Let me know if you need more help. Martynas

Re: Implementing RDF reader

2015-05-14 Thread Martynas Jusevičius
/15 21:48, Martynas Jusevičius wrote: Hey all, I want to refactor my RDF/POST parser into a Jena-compatible reader. An example of the format can be found here: http://www.lsrn.org/semweb/rdfpost.html#sec-examples The documentation suggests implementing ReaderRIOT interface: https

Re: Implementing RDF reader

2015-05-11 Thread Martynas Jusevičius
wrote: On 10/05/15 21:48, Martynas Jusevičius wrote: Hey all, I want to refactor my RDF/POST parser into a Jena-compatible reader. An example of the format can be found here: http://www.lsrn.org/semweb/rdfpost.html#sec-examples The documentation suggests implementing ReaderRIOT interface

Implementing RDF reader

2015-05-10 Thread Martynas Jusevičius
Hey all, I want to refactor my RDF/POST parser into a Jena-compatible reader. An example of the format can be found here: http://www.lsrn.org/semweb/rdfpost.html#sec-examples The documentation suggests implementing ReaderRIOT interface:

Re: Problem with read/write N-Quads/TriG

2015-04-22 Thread Martynas Jusevičius
Model is for triples. You have to use Dataset for quads. https://jena.apache.org/documentation/javadoc/arq/com/hp/hpl/jena/query/Dataset.html On Wed, Apr 22, 2015 at 9:48 PM, Wojciech Ciesielski woj...@kierzbun.pl wrote: Hi On start sorry for my bad english. I must do small example project

Re: Preprocessor or formatting data in fuseki

2015-03-31 Thread Martynas Jusevičius
Nauman, you might find this XSLT transformation useful -- it groups and sorts resource descriptions in RDF/XML: https://github.com/Graphity/graphity-client/blob/master/src/main/webapp/static/org/graphity/client/xsl/group-sort-triples.xsl On Tue, Mar 31, 2015 at 6:02 PM, Stian Soiland-Reyes

Re: Fuse (1 and 2) XMLLiteral becoming escaped

2015-03-19 Thread Martynas Jusevičius
My wild guess would be that your 1st XMLLiteral is not canonical because of the special characters should be entities. On Mar 19, 2015 3:24 PM, Paul p...@proxml.be wrote: Dear, a) case 1 - input into Fuseki dc:description rdf:parseType=Literal div class=egpRond wijwatervat

Re: Fuse (1 and 2) XMLLiteral becoming escaped

2015-03-19 Thread Martynas Jusevičius
for the datatype, Jena outputs in the rdf:datatype form. Andy On 19/03/15 14:34, Martynas Jusevičius wrote: My wild guess would be that your 1st XMLLiteral is not canonical because of the special characters should be entities. On Mar 19, 2015 3:24 PM, Paul p...@proxml.be wrote: Dear

Re: Programmatic SPARQL 1.1

2015-03-16 Thread Martynas Jusevičius
You can use SPIN API an operate the SPARQL query structure as RDF. We have developed a helper class for this purpose: https://github.com/Graphity/graphity-client/blob/master/src/main/java/org/graphity/processor/update/ModifyBuilder.java On Tue, Mar 10, 2015 at 9:32 AM, Maarten van Dessel

Re: How to write RDF model to a Semantic Database

2015-03-16 Thread Martynas Jusevičius
Have you tried looking at the official documentation? Here is an example with transactions: http://jena.apache.org/documentation/tdb/tdb_transactions.html#write-transactions On Mon, Mar 16, 2015 at 6:54 PM, Prasad Priyadarshana Fernando bpp...@gmail.com wrote: Can anyone give me an example for

Re: model.empty()

2015-03-02 Thread Martynas Jusevičius
model.listStatements.hasNext() does seem to test correctly if a model is empty. Op 2-mrt.-2015, om 18:04 heeft Martynas Jusevičius marty...@graphity.org het volgende geschreven: What's the query code? You are probably querying from an inferencing model that imports example.com ontology

Re: Remov a Statement with specific predicate and object from a Model

2015-02-27 Thread Martynas Jusevičius
There is also createPlainLiteral() and createTypedLiteral(): https://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/rdf/model/ResourceFactory.html On Fri, Feb 27, 2015 at 4:36 PM, Trevor Donaldson tmdona...@gmail.com wrote: Hi Marco, I think you want

Re: Params.httpString() URI-encoding

2015-02-20 Thread Martynas Jusevičius
https://issues.apache.org/jira/browse/JENA-884 On Fri, Feb 20, 2015 at 1:00 PM, Andy Seaborne a...@apache.org wrote: On 19/02/15 21:56, Martynas Jusevičius wrote: Hey, I have some code that adds query parameters to SPARQL Protocol requests. According to my quick research, the final HTTP

Params.httpString() URI-encoding

2015-02-19 Thread Martynas Jusevičius
Hey, I have some code that adds query parameters to SPARQL Protocol requests. According to my quick research, the final HTTP query string depends on com.hp.hpl.jena.sparql.engine.http.Params.httpString(): public String httpString() { StringBuffer sbuff = new StringBuffer() ;

Re: Best way to synchonize across graphs

2015-01-28 Thread Martynas Jusevičius
HTTP error code 403 means the client does not have access to the requested resource: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4 On Thu, Jan 29, 2015 at 2:57 AM, Trevor Donaldson tmdona...@gmail.com wrote: Trying to use DatasetAccessor. I am getting the following error.

Re: Adding NegativePropertyAssertion to ABox

2015-01-26 Thread Martynas Jusevičius
I think an even shorter version should work, as most Resource methods follow the builder pattern: negativePropertyAssertion.addProperty(OWL2.assertionProperty, hasPropertyR). addProperty(OWL2.sourceIndividual, sourceIndividual). addProperty(OWL2.targetIndividual,

Re: Encoding RDFNode as N-Triples token (for the Sesame REST HTTP Protocol)

2015-01-26 Thread Martynas Jusevičius
Is there some code that can build the VALUES part from QuerySolutionMap? On Fri, Jan 23, 2015 at 9:22 PM, Andy Seaborne a...@apache.org wrote: On 23/01/15 19:52, Martynas Jusevičius wrote: Hey, I need to implement Sesame HTTP protocol for remotely parameterized queries: http://rdf4j.org

Encoding RDFNode as N-Triples token (for the Sesame REST HTTP Protocol)

2015-01-23 Thread Martynas Jusevičius
Hey, I need to implement Sesame HTTP protocol for remotely parameterized queries: http://rdf4j.org/sesame/2.7/docs/system.docbook?view#repository-queries My plan is to pass QuerySolutionMap to the QueryEngineHTTP level which then would encode the values as N-Triples and add them to the query

Re: Encoding RDFNode as N-Triples token (for the Sesame REST HTTP Protocol)

2015-01-23 Thread Martynas Jusevičius
pass the parameters remotely, then this step is avoided. On Fri, Jan 23, 2015 at 9:22 PM, Andy Seaborne a...@apache.org wrote: On 23/01/15 19:52, Martynas Jusevičius wrote: Hey, I need to implement Sesame HTTP protocol for remotely parameterized queries: http://rdf4j.org/sesame/2.7/docs

Re: Graph traversal and Jena TDB

2015-01-09 Thread Martynas Jusevičius
There was some interesting research from Microsoft about their Trinity RDF store, could be relevant here: http://research.microsoft.com/apps/pubs/default.aspx?id=183717 On Fri, Jan 9, 2015 at 7:05 PM, Andy Seaborne a...@apache.org wrote: On 09/01/15 11:08, Olivier Rossel wrote: Hi everyone.

Re: How to update fuseki from a local model?

2015-01-09 Thread Martynas Jusevičius
Andy - builder code like this? https://github.com/Graphity/graphity-client/blob/master/src/main/java/org/graphity/processor/update/InsertDataBuilder.java It is based on SPIN though, not on Jena directly. On Fri, Jan 9, 2015 at 6:49 PM, Andy Seaborne a...@apache.org wrote: On 09/01/15 15:13,

Re: Validating and resolving RDF URIs

2015-01-08 Thread Martynas Jusevičius
Thanks. Couldn't Jena's IRI be made to extend java.net.URI, override the methods that differ, and still be accepted where URI is expected? On Tue, Jan 6, 2015 at 10:27 PM, Andy Seaborne a...@apache.org wrote: On 06/01/15 16:22, Martynas Jusevičius wrote: Hey, I'm reading URIs from request

Re: Design a JEE / Jena TDB / MVC web application - best practice

2015-01-06 Thread Martynas Jusevičius
/files/AliBabaElmo/1.5/openrdf-elmo-1.5.zip/download There is a nice user guide in the zip file, that gives a lot of details about how to annotate beans so the persistence is transparent. I think inheritance is explained too. On Tue, Jan 6, 2015 at 2:29 AM, Martynas Jusevičius marty

Validating and resolving RDF URIs

2015-01-06 Thread Martynas Jusevičius
Hey, I'm reading URIs from request input that will end up in an RDF Model. They can be relative, in which case they need to be resolved, and they can be invalid, in which case they need to be rejected. What I'm looking for is to replace new URI/URI.create() and URI.resolve(uri) usages with a

Re: Design a JEE / Jena TDB / MVC web application - best practice

2015-01-05 Thread Martynas Jusevičius
Nicolas, I suggest you also take a look at Graphity Client: https://github.com/Graphity/graphity-client You don't really need an object layer representing your RDF classes above Jena, it is a bottleneck. You can express both the webapp structure and the instance data as RDF, and define a mapping

Re: Using Model inside Java Objects.

2014-11-27 Thread Martynas Jusevičius
David, in my experience this approach only gives you the object-model impedance mismatch and no real advantages. Have you considered working directly on Jena Models and Resources? Martynas graphityhq.com On Thu, Nov 20, 2014 at 11:13 PM, David Moss admo...@gmail.com wrote: Until now I have

Re: RDF/XML-ABBREV problems with inline node expansion

2014-11-17 Thread Martynas Jusevičius
PM, Hammond, Tony tony.hamm...@macmillan.com wrote: Hi Martynas: As said: The basic RDF/XML output from Jena is not what we need. We just need a better, more regular, RDF/XML-ABBREV such as the rapper output. Cheers, Tony On 17/11/2014 14:35, Martynas Jusevičius marty...@graphity.org

Re: Good Style to interact with Jena

2014-10-22 Thread Martynas Jusevičius
Benjamin, Regarding creation of RDF from SQL (relational databases), take a look at D2RQ: http://d2rq.org You can define a declarative mapping and pass it to D2RQ. In the ideal case you won't even have to touch Java. Martynas On Thu, Oct 9, 2014 at 11:02 PM, Benjamin Eckstein umi...@gmail.com

Re: FILTER NOT EXISTS semantics

2014-09-30 Thread Martynas Jusevičius
Thanks Andy! On Sep 29, 2014 10:22 PM, Andy Seaborne a...@apache.org wrote: On 29/09/14 12:56, Martynas Jusevičius wrote: OK, I realize now the valid ?subject was still matching the FILTER pattern. I guess what I need here is MINUS: PREFIX dct: http://purl.org/dc/terms/ PREFIX gr: http

FILTER NOT EXISTS semantics

2014-09-29 Thread Martynas Jusevičius
Hey, can someone explain to me why the following query returns no results: PREFIX dct: http://purl.org/dc/terms/ PREFIX gr: http://purl.org/goodrelations/v1# PREFIX skos: http://www.w3.org/2004/02/skos/core# SELECT * WHERE { ?this a gr:ProductOrServiceModel . FILTER NOT EXISTS {

Re: FILTER NOT EXISTS semantics

2014-09-29 Thread Martynas Jusevičius
a skos:Concept } } On Mon, Sep 29, 2014 at 2:15 PM, Martynas Jusevičius marty...@graphity.org wrote: Hey, can someone explain to me why the following query returns no results: PREFIX dct: http://purl.org/dc/terms/ PREFIX gr: http://purl.org/goodrelations/v1# PREFIX skos: http://www.w3.org

ReorderTransformationBase logging

2014-09-17 Thread Martynas Jusevičius
Hey, could the logging level of this class be reduced to TRACE? Right now it is DEBUG and produces a lot of quite cryptic output. Martynas

Re: Assembler for Datasets

2014-09-04 Thread Martynas Jusevičius
couldn't see any openDataset() or similar methods that would return the assembled Dataset? Martynas On Sun, Aug 24, 2014 at 3:12 PM, Andy Seaborne a...@apache.org wrote: On 23/08/14 23:43, Martynas Jusevičius wrote: Hey, are there any examples on how to assemble a Dataset, with files becoming

Re: OntModel resources - main or imported?

2014-08-26 Thread Martynas Jusevičius
On Tue, Aug 26, 2014 at 9:57 AM, Dave Reynolds dave.e.reyno...@gmail.com wrote: On 26/08/14 02:10, Martynas Jusevičius wrote: Hey, is it possible to check if resource in OntModel comes from the main/root ontology or the owl:imports? Is thought that is what isInBaseModel() does, but I don't get

OntModel resources - main or imported?

2014-08-25 Thread Martynas Jusevičius
Hey, is it possible to check if resource in OntModel comes from the main/root ontology or the owl:imports? Is thought that is what isInBaseModel() does, but I don't get expected result.

Assembler for Datasets

2014-08-23 Thread Martynas Jusevičius
Hey, are there any examples on how to assemble a Dataset, with files becoming (possibly renamed) named graphs? Or maybe assembler is not the right tool for this? I checked the how-to but it's mostly about Models. https://jena.apache.org/documentation/assembler/assembler-howto.html Martynas

Turning off RDF/XML canonicalization check

2014-06-25 Thread Martynas Jusevičius
Hey, is this possible? Or is there a workaround? I need XMLLiteral as embedded XML (actually XHTML) regardless if it's canonical or not, otherwise XSLT processing breaks. I've tuned the XHTML quite sucessfully, but still there are some large literals failing, even though they look canonical to

Re: Turning off RDF/XML canonicalization check

2014-06-25 Thread Martynas Jusevičius
I would be willing to fix the XHTML as well, but I haven't found a way to identify exactly what causes the problem. I'm attaching the file, maybe that helps. On Wed, Jun 25, 2014 at 9:41 PM, Martynas Jusevičius marty...@graphity.org wrote: Hey, is this possible? Or is there a workaround? I

Re: Consistency checking

2014-04-27 Thread Martynas Jusevičius
Hey Cindy, Check SPIN constraints: http://spinrdf.org/spin.html#spin-constraints Martynas graphityhq.com On Apr 27, 2014 1:41 PM, Cindy A McMullen cindy.mcmul...@oracle.com wrote: Hi - Is there a way to check the consistency of triples with one's ontology prior to insertion into the graph?

Re: Jena libraries in Netbeans

2014-04-26 Thread Martynas Jusevičius
David, Using Jena as Maven dependencies is much easier. Martynas On Apr 26, 2014 9:32 AM, David Moss admo...@gmail.com wrote: Jena libraries in Netbeans Saturday, 26 April 2014 12:38 PM Adding Jena to Netbeans was interesting. Lots of trial and error. There were tutorials on how to

Re: Building Semantic Web Application

2014-04-18 Thread Martynas Jusevičius
Mohammad, I think Ordnance Survey Linked Data is a good example that it can: http://data.ordnancesurvey.co.uk Martynas On Fri, Apr 18, 2014 at 12:09 PM, Mohammad Hailmizan Bin Jafar hailmizan.ja...@egc.gov.bn wrote: I would like to build e-govt service application (e-services) such as Land

Re: Sparql To SQL

2014-03-30 Thread Martynas Jusevičius
Hey, have you tried D2RQ? http://d2rq.org Martynas On Sun, Mar 30, 2014 at 11:37 AM, Kamalraj Jairam kjai...@semanticsoftware.com.au wrote: Hello All, Whats the best way to convert sparql to SQL using R2RML mappings and convert resultset from DB to RDF? Thanks -- Kjairam Sent with

Re: Sparql To SQL

2014-03-30 Thread Martynas Jusevičius
There are also commercial options, e.g. this: http://www.revelytix.com/content/spyder On Sun, Mar 30, 2014 at 10:15 PM, Kamalraj Jairam kjai...@semanticsoftware.com.au wrote: Hello Paul, These are the informtion i have 1) R2RML mapping for existing DB 2) I have some fedreated queries which

Re: A query with an OR smaller doesn't work, but the same OR bigger does!

2014-03-08 Thread Martynas Jusevičius
Jose, sorry can't help with your question - just wanted to let you know that FILTER (?actor IN (http://data.linkedmdb.org/resource/actor/30711, ...)) is a shorter version of the same expression, in case you were not aware: http://www.w3.org/TR/sparql11-query/#func-in Are you implementing

Re: Fuskei: ordering in Construct

2014-02-27 Thread Martynas Jusevičius
Mark, if you are using DESCRIBE or CONSTRUCT queries then the result you get is a Model. And a model is a set of statements which is not ordered. You can do post-processing to sort them the way you want, e.g. when you are presenting data to the user. Martynas On Thu, Feb 27, 2014 at 2:29 PM,

Re: Fuskei: ordering in Construct

2014-02-27 Thread Martynas Jusevičius
On Thu, 27 Feb 2014 14:34:49 +0100 Martynas Jusevičius marty...@graphity.org wrote: Mark, if you are using DESCRIBE or CONSTRUCT queries then the result you get is a Model. And a model is a set of statements which is not ordered. You can do post-processing to sort them the way you want, e.g. when

Re: SPARQL 1.1 Graphstore Protocol

2014-02-09 Thread Martynas Jusevičius
Will, check DatasetAdapter: http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/web/DatasetAdapter.html Martynas On Mon, Feb 10, 2014 at 12:52 AM, Will william_gree...@hotmail.com wrote: Hi, I am writing some Groovy extensions for Jena, but am struggling to find anything about

Re: controlling RDF/XML-ABBREV output

2014-02-08 Thread Martynas Jusevičius
One option is to do post-processing with XSLT. Here's a stylesheet that groups and sorts resource descriptions and properties within them: https://github.com/Graphity/graphity-browser/blob/master/src/main/webapp/static/org/graphity/client/xsl/group-sort-triples.xsl Martynas graphityhq.com On

Re: Update an existing TDB with a RDF file

2014-01-29 Thread Martynas Jusevičius
Frederic, are you sure this hasn't been done before? I've used JenaBean [1], but I know there are at least several other similar projects. Martynas [1] https://code.google.com/p/jenabean/ On Wed, Jan 29, 2014 at 2:58 PM, Frederic Toublanc frederic.toubl...@telemis.com wrote: Ok thx a lot :)

Re: Escaping SPARQL regex

2014-01-22 Thread Martynas Jusevičius
Thanks Andy. REUtil.quoteMeta() seems to do the trick. On Tue, Jan 21, 2014 at 6:22 PM, Andy Seaborne a...@apache.org wrote: On 21/01/14 16:58, Martynas Jusevičius wrote: Andy, what if I'm sending the query to a remote endpoint that does not support Java style regex syntax? Do I need to use

Re: Escaping SPARQL regex

2014-01-21 Thread Martynas Jusevičius
= ... + filter(regex(...,\+35\) + ...; Sorry for the hasty and inaccurate reply. On Mon, Jan 20, 2014 at 9:27 PM, Joshua TAYLOR joshuaaa...@gmail.com wrote: On Mon, Jan 20, 2014 at 8:48 PM, Martynas Jusevičius marty...@graphity.org wrote: OK maybe +35 was a bad example. But isn't + a special

Escaping SPARQL regex

2014-01-20 Thread Martynas Jusevičius
Hey, is there a way to build a SPARQL-specific regex string in Jena? Now I'm using the Pattern class to implement simple regex() based search. If the search string contains special characters, escaping is done but the syntax does not seem to work. For example,

Re: Escaping SPARQL regex

2014-01-20 Thread Martynas Jusevičius
/#grammarEscapes On Tue, Jan 21, 2014 at 1:59 AM, Joshua TAYLOR joshuaaa...@gmail.com wrote: On Mon, Jan 20, 2014 at 7:30 PM, Martynas Jusevičius marty...@graphity.org wrote: For example, Pattern.compile(Pattern.quote(+35)) produces query with FILTER regex(str(?label), \\Q+35\\E, i) which returns

Re: HttpException: 411 - Length Required

2013-12-12 Thread Martynas Jusevičius
Andy, speaking of nginx - maybe you happen to know if is possible to limit request content size without a Content-Length header? Martynas On Tue, Dec 10, 2013 at 6:53 PM, Andy Seaborne a...@apache.org wrote: On 10/12/13 16:26, Martynas Jusevičius wrote: I'm upgrading from an old version

HttpException: 411 - Length Required

2013-12-10 Thread Martynas Jusevičius
Hey, after upgrade to 2.11.0 I get this exception during Graph Store Protocol request: org.apache.jena.atlas.web.HttpException: 411 - Length Required org.apache.jena.riot.web.HttpOp.exec(HttpOp.java:1020) org.apache.jena.riot.web.HttpOp.execHttpPost(HttpOp.java:633)

Re: HttpException: 411 - Length Required

2013-12-10 Thread Martynas Jusevičius
wrote: On 10/12/13 14:33, Martynas Jusevičius wrote: Hey, after upgrade to 2.11.0 I get this exception during Graph Store Protocol request: org.apache.jena.atlas.web.HttpException: 411 - Length Required org.apache.jena.riot.web.HttpOp.exec(HttpOp.java:1020

RDF/XML writer bug in 2.11.0?

2013-12-08 Thread Martynas Jusevičius
Hey, I've upgraded to Jena 2.11.0 as part of SPIN API 1.3.1. As a result, previously working RDF/XML output breaks: com.hp.hpl.jena.shared.BadURIException: Only well-formed absolute URIrefs can be included in RDF/XML output: # Code: 57/REQUIRED_COMPONENT_MISSING in SCHEME: A component that is

Re: Alternative to org.openjena.riot.WebContent?

2013-12-06 Thread Martynas Jusevičius
if RDFLanguages.contentTypeToLang() returns null before calling read()/write(). On Fri, Dec 6, 2013 at 1:39 PM, Andy Seaborne a...@apache.org wrote: On 06/12/13 12:08, Martynas Jusevičius wrote: Thanks Andy. Yes looks like I have some upgrading to do... Can you provide more info about that FileManager adapter

Re: How to correct com.hp.hpl.jena.rdf.model.HasNoModelException

2013-12-05 Thread Martynas Jusevičius
This might happen if the Resource object has been created using ResourceFactory.createResource(), in which case its getModel() returns null. Martynas graphityhq.com On Thu, Dec 5, 2013 at 2:44 PM, Dibyanshu Jaiswal djthequ...@gmail.com wrote: Hi! I using JenaParliament for spatial queries.

Alternative to org.openjena.riot.WebContent?

2013-12-05 Thread Martynas Jusevičius
Hey, I'm using constants from org.openjena.riot.WebContent, such as WebContent.contentTypeRDFXML, WebContent.langRDFXML etc. After upgrading to Jena 2.11.0 (as part of SPIN API 1.3.1), the WebContent class is not there anymore. What can I use instead? Thanks. Martynas

Re: Alternative to org.openjena.riot.WebContent?

2013-12-05 Thread Martynas Jusevičius
(WebContent.contentTypeTurtle, WebContent.langTurtle); // snip } Martynas On Thu, Dec 5, 2013 at 11:45 PM, Martynas Jusevičius marty...@graphity.org wrote: Hey, I'm using constants from org.openjena.riot.WebContent, such as WebContent.contentTypeRDFXML, WebContent.langRDFXML etc. After

Re: Alternative to org.openjena.riot.WebContent?

2013-12-05 Thread Martynas Jusevičius
) and use constants not Strings. Andy On 05/12/13 22:57, Martynas Jusevičius wrote: Or rather, what functionality can replace langFromContentType() that I was using to convert media type to Jena syntax name: String syntax = langFromContentType(in.getMimeType

Re: call a Sparql command in a rule, is it possible?

2013-12-05 Thread Martynas Jusevičius
Miguel, not exactly sure, but maybe SPIN rules could help you? http://spinrdf.org/spin.html#spin-rules Martynas On Fri, Dec 6, 2013 at 1:20 AM, Miguel Bento Alves mbentoal...@gmail.com wrote: Is it possible call a Sparql command in a rule? Can we do that with a custom built-in function? An

Re: Building xsd:dateTime from xsd:gYear + xsd:gMonth + xsd:gDay

2013-11-14 Thread Martynas Jusevičius
, you can then use createTypedLiteral(String lex, RDFDatatype dtype) Not all mandatory - the format can be , -MM, -MM-DD. You could build the lexical form. Andy On 14/11/13 02:02, Martynas Jusevičius wrote: Hey, I have datetime components as 3 separate literals

Re: Building xsd:dateTime from xsd:gYear + xsd:gMonth + xsd:gDay

2013-11-14 Thread Martynas Jusevičius
OK I was probably too quick - now I realized the syntax of xsd:gMonth and xsd:gDay is not so simple... On Thu, Nov 14, 2013 at 4:05 PM, Martynas Jusevičius marty...@graphity.org wrote: I came up with an approach that concatenates lexical values and doesn't need Calendar or DateTimeStruct

Re: Building xsd:dateTime from xsd:gYear + xsd:gMonth + xsd:gDay

2013-11-14 Thread Martynas Jusevičius
, Andy Seaborne a...@apache.org wrote: On 14/11/13 16:42, Martynas Jusevičius wrote: OK I was probably too quick - now I realized the syntax of xsd:gMonth and xsd:gDay is not so simple... :-) http://www.w3.org/TR/xmlschema11-2/#dateTime for details. The range of time:month is a non

Re: Building xsd:dateTime from xsd:gYear + xsd:gMonth + xsd:gDay

2013-11-14 Thread Martynas Jusevičius
BTW, there seems to be a related question on StackOverflow: http://answers.semanticweb.com/questions/610/ordering-by-time-in-sparql-query I might just give up building an xsd:dateTime and use separate year/month/day components. On Thu, Nov 14, 2013 at 7:26 PM, Martynas Jusevičius marty

Re: Building xsd:dateTime from xsd:gYear + xsd:gMonth + xsd:gDay

2013-11-14 Thread Martynas Jusevičius
: On 14/11/13 18:29, Martynas Jusevičius wrote: BTW, there seems to be a related question on StackOverflow: http://answers.semanticweb.com/questions/610/ordering-by-time-in-sparql-query I might just give up building an xsd:dateTime and use separate year/month/day components. On Thu, Nov 14

Building xsd:dateTime from xsd:gYear + xsd:gMonth + xsd:gDay

2013-11-13 Thread Martynas Jusevičius
Hey, I have datetime components as 3 separate literals, with xsd:gYear, xsd:gMonth, xsd:gDay respective datatypes. Not all mandatory - the format can be , -MM, -MM-DD. Now how do I combine those into a single xsd:dateTime Literal? A concrete use case would be converting

NPE in QueryHTTPEngine.execModel() (ARQ 2.9.2)

2013-10-29 Thread Martynas Jusevičius
Hey, one of Graphity users has configured it with Sesame SPARQL endpoint, but he gets an NPE in ARQ code: 11:15:54,198 DEBUG DataManager:98 - Remote service http://localhost:8080/openrdf-workbench/repositories/odn/query Query: DESCRIBE ?instance http://192.168.122.30:8080/graphity-browser/ WHERE

Re: How to export uri prefixes within a resourse value

2013-10-29 Thread Martynas Jusevičius
What you want can be done on the syntactic XML level using entities: rdf:type rdf:resource=rdfs;Resource/ This would require a local entity definition however: !DOCTYPE rdf:RDF [ !ENTITY rdfs http://www.w3.org/2000/01/rdf-schema#; ] I don't think it can be done using qualified names as

SERVICE within GRAPH

2013-09-29 Thread Martynas Jusevičius
Hey, I want to do federation between to endpoints, both of which contain named graphs. I'm trying a query of this shape: PREFIX foaf: http://xmlns.com/foaf/0.1/ PREFIX acl: http://www.w3.org/ns/auth/acl# SELECT * WHERE { GRAPH

Re: Tool to build model from scratch

2013-09-25 Thread Martynas Jusevičius
Charles, you can try Graphity for UI building: https://github.com/Graphity/graphity-browser It transforms RDF/XML to (X)HTML using modular XSLT templates, and includes default generic layout as well as specialized stylehseets for vocabularies such as GoodRelations (which should be useful for

Re: Fuseki DatasetAdapter not escaping graph URI?

2013-09-14 Thread Martynas Jusevičius
AM, Andy Seaborne a...@apache.org wrote: Version? IIRC there was a fix around here not so long ago. On 13/09/13 12:41, Martynas Jusevičius wrote: This is probably the correct encoded value (including slashes etc): http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx http%3A

Re: Fuseki DatasetAdapter not escaping graph URI?

2013-09-14 Thread Martynas Jusevičius
Ok, I found it and the new target(Node name) method seems to do the trick: https://svn.apache.org/repos/asf/jena/trunk/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java On Sat, Sep 14, 2013 at 1:49 PM, Martynas Jusevičius marty...@graphity.org wrote: Sorry about

Fuseki DatasetAdapter not escaping graph URI?

2013-09-13 Thread Martynas Jusevičius
Hey, I'm using DatasetAdapter to access a Graph Store. It seems to me however that it is not properly escaping graph URI when building the request URI. 4.2 Indirect Graph Identification (http://www.w3.org/TR/sparql11-http-rdf-update/#indirect-graph-identification) gives an example of encoded

Re: Fuseki DatasetAdapter not escaping graph URI?

2013-09-13 Thread Martynas Jusevičius
This is probably the correct encoded value (including slashes etc): http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx On Fri, Sep 13, 2013 at 1:35 PM, Martynas Jusevičius marty...@graphity.org wrote: Hey, I'm using DatasetAdapter to access a Graph Store. It seems to me

Re: Bug with xsd:date datatype

2013-09-12 Thread Martynas Jusevičius
Does November ever have 31 days? On Thu, Sep 12, 2013 at 12:47 PM, Julien Plu julien@redaction-developpez.com wrote: Hi, I use Jena 2.10.1 to compute the age of people from french DBpedia dataset. When I retrieve a date, sometimes, this code date.getValue(), where date is a Literal,

Re: JSON-LD as a Fuseki output format

2013-09-05 Thread Martynas Jusevičius
I've developed a basic XSLT 2.0 stylesheet transforming Jena's RDF/XML into simple JSON-LD: https://github.com/Graphity/graphity-browser/blob/master/src/main/resources/org/graphity/client/writer/rdfxml2json-ld.xsl Graphity's JSONLDWriter can be used as a MessageBodyWriterModel provider in a

Re: Naming entities

2013-08-15 Thread Martynas Jusevičius
Where uniqueness is more important than readability, I would go with UUIDs. On Thu, Aug 15, 2013 at 2:03 AM, David Moss admo...@gmail.com wrote: This is a fairly basic question, but how do others go about naming entities in an RDF graph? The semantic web evangelists are keen on URIs that

Re: Leaving URIs relative

2013-08-15 Thread Martynas Jusevičius
No, URIs are absolute in RDF model, even though they can be relative in serializations. Why don't you use base URI (@base in Turtle) and/or prefixes so that URIs stay stable no matter where you load the file from? Martynas On Thu, Aug 15, 2013 at 5:39 PM, Norman Walsh n...@nwalsh.com wrote:

Re: Leaving URIs relative

2013-08-15 Thread Martynas Jusevičius
...@nwalsh.com wrote: Martynas Jusevičius marty...@graphity.org writes: No, URIs are absolute in RDF model, even though they can be relative in serializations. Why don't you use base URI (@base in Turtle) and/or prefixes so that URIs stay stable no matter where you load the file from? It's

Re: convert SPARQL query to a query tree

2013-08-02 Thread Martynas Jusevičius
Also consider SPIN from TopQuadrant. SPIN can represent SPARQL as RDF. There is a vocabulary and API: http://spinrdf.org/spin.html http://topbraid.org/spin/api/ Martynas graphityhq.com On Fri, Aug 2, 2013 at 10:55 AM, Amin beyranvand amin_2...@yahoo.com wrote: Hi I want to write an engine

Re: Using Fuseki as an HTTP and GSP component

2013-07-25 Thread Martynas Jusevičius
Luis, not directly related to Fuseki, but you could implement a custom GS using JAX-RS interfaces from Graphity: https://github.com/Graphity/graphity-ldp/blob/master/src/main/java/org/graphity/server/model/GraphStore.java There is also a Jena-compatible implementation that functions as a proxy

UpdateProcessRemote authentication

2013-07-14 Thread Martynas Jusevičius
Hey, I know changes were introduced (and bugs fixed) in this area, but I'm having trouble getting update requests to work with HTTP Basic authentication. This code should send authenticated INSERT to Dydra: UpdateRequest update = UpdateFactory.create(uString);

Re: Tr : Basic Authentication for SPARQL Update

2013-06-26 Thread Martynas Jusevičius
Rob, as a sidenote for this thread and some previous ones about uniform HTTP access in Jena, I wanted to show how easily authentication can be done using Jersey (implementation of JAX-RS). This is from Graphity subclass of UpdateProcessRemote: @Override public void execute() {

Re: Spin integration

2013-05-29 Thread Martynas Jusevičius
Hey Matias, I'm using SPIN API in Graphity Linked Data platform. Here's an example of a SPIN-based SPARQL QueryBuilder: https://github.com/Graphity/graphity-browser/blob/master/src/main/java/org/graphity/processor/query/QueryBuilder.java I'm also planning to use SPIN constraints to validate

Re: Spin integration

2013-05-29 Thread Martynas Jusevičius
it on startup, I'm trying to find an example now. On Wed, May 29, 2013 at 11:44 AM, Martynas Jusevičius marty...@graphity.org wrote: Hey Matias, I'm using SPIN API in Graphity Linked Data platform. Here's an example of a SPIN-based SPARQL QueryBuilder: https://github.com/Graphity/graphity-browser

Static Logger references

2013-05-08 Thread Martynas Jusevičius
Hey, Jena uses a pattern to define static Logger objects that I have adopted: private static Logger log = LoggerFactory.getLogger(FileManager.class) ; However some online material indicates this pattern as a possible source of memory leaks, especially when the application is deployed in a

Problem serializing ORDER BY ASC() in Query?

2013-05-07 Thread Martynas Jusevičius
Hey, with such query string SELECT * { ?s ?p ?o } ORDER BY ASC(STR(?o)) passed into QueryFactory.create() and calling toString() on the Query object, what I get back is: SELECT * WHERE { ?s ?p ?o } ORDER BY ASCstr(?o) where ASC is missing parentheses . DESC() doesn't have this

Re: Problem serializing ORDER BY ASC() in Query?

2013-05-07 Thread Martynas Jusevičius
BTW, I'm using Jena 2.7.2 / ARQ 2.9.2. On Tue, May 7, 2013 at 9:34 PM, Martynas Jusevičius marty...@graphity.org wrote: Hey, with such query string SELECT * { ?s ?p ?o } ORDER BY ASC(STR(?o)) passed into QueryFactory.create() and calling toString() on the Query object, what I get back

QueryEngineHTTP.setInitialBinding() using ParameterizedSparqlString?

2013-04-03 Thread Martynas Jusevičius
Hey all, QueryEngineHTTP does not implement setInitialBindings() due to Jena's implementation specifics, as I found out a while ago: http://mail-archives.apache.org/mod_mbox/jena-users/201201.mbox/%3c4f11b03e.7040...@apache.org%3E However, this lack of uniformity prevents generic code that

Re: QueryEngineHTTP.setInitialBinding() using ParameterizedSparqlString?

2013-04-03 Thread Martynas Jusevičius
be to inject a VALUES clause into the query though there may be some issues with scoping and collision with existing VALUES clauses Feel free to open a JIRA Rob On 4/3/13 9:21 AM, Martynas Jusevičius marty...@graphity.org wrote: Hey all, QueryEngineHTTP does not implement

Re: Architecture Direction

2013-03-27 Thread Martynas Jusevičius
Claude, SPARQL endpoint implementation in Graphity Linked Data server can proxy another endpoint, or serve a local Model. It can be accessed via HTTP or directly through JAX-RS object methods:

Re: Owl instance testing with Jena

2013-03-05 Thread Martynas Jusevičius
Vegard, have you looked at SPIN constraints? http://spinrdf.org/spin.html#spin-constraints http://semwebquality.org/ontologies/dq-constraints Martynas graphity.org On Tue, Mar 5, 2013 at 10:20 AM, Vegard Vaage vegard.va...@tv2.no wrote: Hi! I'm trying to verify instance data against an

Re: srv:serviceContext in QueryEngineHTTP

2013-02-26 Thread Martynas Jusevičius
at 1:49 PM, Martynas Jusevičius marty...@graphity.org wrote: Hey, I'm running SPARQL queries on endpoints with HTTP Basic authentication, and am looking for a convenient way to manage and configure the credentials. Currently I've implemented a simple registry that checks endpoint URIs

Re: srv:serviceContext in QueryEngineHTTP

2013-02-26 Thread Martynas Jusevičius
have moved on since then. How do things stand relative to Jena 2.10.0? On 26/02/13 13:45, Martynas Jusevičius wrote: I extended QueryEngineHTTP to achieve what I had described: https://raw.github.com/Graphity/graphity-ldp/rf-input-mode/src/main/java/org/graphity/ldp/query/QueryEngineHTTP.java

DEBUG FBRuleInfGraph messages

2013-02-21 Thread Martynas Jusevičius
Hey, how can I switch off the inference rule debug messages like this one: 12:37:13,406 DEBUG FBRuleInfGraph:264 - Adding rule [ (?x http://spinrdf.org/sp#variable ?y) - (?x rdf:type http://spinrdf.org/sp#Bind) ] I'm using Jena 2.7.2. I tried this in log4j.properties but it doesn't seem to

<    2   3   4   5   6   7   8   >