Re: SPARQL query for instances that do not belong to certain class
On 26/06/13 07:40, Katja Siegemund wrote: Hello, I'm trying to get negated data with SPARQL (individuals of an ontology that do not belong to a certain class), but I could not figure out how to write the appropriate query therefore. It's working for object properties and using FILTER NOT EXIST, but this one I can't manage. Could you help me out here please? The query should somehow look like this: PREFIX ro:http://www.semanticweb.org/ontologies/2012/4/test_ontology.owl# SELECT ?r WHERE NOT{?r a ro:RelatedRequirement}; The NOT is just placed here to indicate that I want to get all individuals that are NOT instances of the ontology class RelatedRequirement. Thanks, Katja (I don't know the data model) The approach is to find everything meeting a more general condition then remove the things that match the specific condition {?r a ro:RelatedRequirement}. The more you can limit the initial find everything / general condition, the faster the query will go. e.g if they will all have a particular type, :TypeALL, then use :TypeAll not ?T below. Then either of: ## Everything with an rdf:type but not ro:RelatedRequirement SELECT DISTINCT ?r WHERE { ?r a ?T FILTER NOT EXISTS { ?r a ro:RelatedRequirement } } SELECT DISTINCT ?r WHERE { ?r a ?T MINUS { ?r a ro:RelatedRequirement } } Andy PS Please start a new thread for a new question - if you reply to an existing message, even if you change the subject line, then people who are ignoring the thread will ignore your new question as well.
Re: Tr : Basic Authentication for SPARQL Update
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() { Client client = Client.create(); WebResource wr = client.resource(endpointURI); if (user != null password != null) client.addFilter(new HTTPBasicAuthFilter(user, password)); ClientResponse response = wr.type(WebContent.contentTypeSPARQLUpdate). accept(WebContent.contentTypeResultsXML). post(ClientResponse.class, request.toString()); } Martynas graphityhq.com On Wed, Jun 26, 2013 at 3:00 AM, Rob Vesse rve...@yarcdata.com wrote: I added simple basic auth support to Fuseki and wrote unit tests that verified that authentication is working correctly. It would be useful to know what error code/messages you get with the latest SNAPSHOTs? Is there any HTTP proxying/redirection involved in your setup? The applyAuthentication() code scopes provided credentials to the given service URI so if the server is responding with a 401 Unauthorized on a different URI then the original request then HTTP Client may be failing to attempt to pass any credentials at all in response to the servers challenge and simply bailing out and throwing up the 401 error Rob On 6/25/13 2:44 AM, Arthur Vaïsse-Lesteven arthurvai...@yahoo.fr wrote: Hi again. It seems that the bug is still present. The HTTPheader not contains basicAuthentification informations. What test did you do about the new httpOp ? I may doing it in a wrong way :/ After the debugged applyAuthentication in HttpOp, there is the following line : HttpResponse response = httpclient.execute(httppost, httpContext); And I think that the HttpClient.execute method doesn't use the authentication information available in his Credential provider. Rob : Don't forget you can always check out and do a mvn install locally Ho yes, I'll do that next time! VAÏSSE-LESTEVEN Arthur. Hmmm, that is a little weird I just forced a rebuild and the latest build does have the change in it, not sure what happened there. Sometimes the Apache build servers are just a little flaky. Don't forget you can always check out and do a mvn install locally Rob From: Arthur Vaïsse-Lesteven arthurvai...@yahoo.frmailto:arthurvai...@yahoo.fr Reply-To: users@jena.apache.orgmailto:users@jena.apache.org users@jena.apache.orgmailto:users@jena.apache.org, Arthur Vaïsse-Lesteven arthurvai...@yahoo.frmailto:arthurvai...@yahoo.fr Date: Monday, June 24, 2013 5:26 AM To: users@jena.apache.orgmailto:users@jena.apache.org users@jena.apache.orgmailto:users@jena.apache.org Subject: Re: Tr : Basic Authentication for SPARQL Update Hi Rob, It's a little confusing. You modified the HttpOp class in the release number 34 on the maven repo [1], but this modification isn't present in the last version ( 38 ) as you can see in the java file joined to this mail. The add of client.setCredentialsProvider(provider); line 400 probably solve the problem but I'm not able to test it as it isn't present in the last released version of ARQ. ( The trunk version of your SVN seems to contains this code too ). Thanks for your work. VAISSE-LESTEVEN Arthur. [1] https://repository.apache.org/content/repositories/snapshots/org/apache/j ena/jena-arq/2.10.2-SNAPSHOT/ De : Rob Vesse rve...@yarcdata.commailto:rve...@yarcdata.com À : users@jena.apache.orgmailto:users@jena.apache.org users@jena.apache.orgmailto:users@jena.apache.org Envoyé le : Vendredi 21 juin 2013 19h35 Objet : Re: Tr : Basic Authentication for SPARQL Update The latest SNAPSHOTS now have the fix, you may need to add -U to your mvn calls if you have recently updated SNAPSHOTs to get the very latest Please test and confirm whether this resolves the issue Rob On 6/21/13 9:13 AM, Rob Vesse rve...@cray.commailto:rve...@cray.com wrote: Nice catch Yes I appear to have made an error, I never associated the created credentials provider with the HTTP Client Filed as JENA-475 (https://issues.apache.org/jira/browse/JENA-475) I will commit a fix ASAP and you should be able to pick up a 2.10.2-SNAPSHOT build in a few hours with the fix, if you can test with the snapshot and report if this resolves the issue that would be great. You can verify whether the fix has gone into the snapshots by looking at https://builds.apache.org/job/Jena__Development_Test/changes and seeing if there is a build listed where the commit messages mention JENA-475 Rob On 6/20/13 11:51 PM, Arthur Vaïsse-Lesteven arthurvai...@yahoo.frmailto:arthurvai...@yahoo.fr wrote: Hi Rob, I'm in trouble with the basic authentication process ( I'm now using ARQ 2.10.1 ) In one hand the Queries work like this : when we calls one of the 4 method execX of a queryExecution, the QueryEngineHTTP calls
Re: Loading triples into empty SDB Store
On 25/06/13 22:54, Cindy A McMullen wrote: Let's make things even simpler: How do I load a set of Quads into SDB via the Java API (not 'sdbloader')? On Jun 25, 2013, at 11:32 AM, Cindy A McMullen wrote: I want to load triples into an empty SDB Store. Here's what I'm trying: Store store = getStore(); GraphSDB graph = new GraphSDB(store); DatasetGraph datasetGraph = DatasetGraphFactory.create(graph); This will not do what you want. It puts a single SDB-backed graph inside a general purpose, in-memory DatasetGraph. It's for use when you are mixing graphs from different places. You seem to be using the previous release of SDB - the current release, with current Jena, will silently create new graphs BUT in-memory. In the last version of SDB you had to explicitly create graphs in the general dataset so it knew which storage layer to use. You want the whole dataset to be SDB-backed: Dataset ds = SDBFactory.connectDataset(...) ; DatasetGraph dsg = ds.asDatasetGraph() ; dsg.add(quad) ; if (datasetGraph.isEmpty()) { System.out.println(Empty dataset graph); // yes, it is } for (EventGraph eventGraph : eventGraphs) // internal classes { persist(eventGraph, datasetGraph); // code below } I'm calling into the same code that I use for in-memory implementation to persist: protected void persist(EventGraph eventGraph, DatasetGraph dsg) { // First, pull the triples from the SetEvent. SetTriple triples = generateTriplesFromGraphEvent(eventGraph); // Named graph node, into which we'll store the event triples Node graphNode = Node.createURI(UUID.randomUUID().toString()); This is not a URI. Either urn:uuid:+UUID.randomUUID().toString() or JenaUUID.generate().asURN() ; // Next, create a Jena Quad for that for (Triple triple : triples) { Quad q = new Quad(graphNode, triple); dsg.add(q); } dsg.add(new Quad(Quad.defaultGraphIRI, createActionTriple(graphNode, eventGraph))); dsg.add(new Quad(Quad.defaultGraphIRI, createTimestampTriple(graphNode, eventGraph))); } --- And get this message for the dsg.add(q) line: Exception in thread main com.hp.hpl.jena.shared.JenaException: No such graph: ef3f02ef-c203-42af-9e3d-9061acf27022 DatasetGraphCollection.add(DatasetGraphCollection.java:41) InMemoryRDFManager.persist(InMemoryRDFManager.java:98) SDBRDFManager.persist(SDBRDFManager.java:58) Any ideas?
AW: unionDefaultGraph problem with Fuseki 0.2.8
Hmm - with unionDefaultGraph set true, triples from my default graph are not found (build #39). When I deactivate the clause, all works fine. Cheers, Joachim -Ursprüngliche Nachricht- Von: Andy Seaborne [mailto:a...@apache.org] Gesendet: Dienstag, 25. Juni 2013 21:51 An: users@jena.apache.org Betreff: Re: unionDefaultGraph problem with Fuseki 0.2.8 On 25/06/13 13:01, Andy Seaborne wrote: On 24/06/13 20:15, Elli Schwarz wrote: I just downloaded the latest snapshot of Fuseki 0.2.8 this morning (revision 1496155 from the trunk) . I'm using config-tdb-text.ttl, (attached) which has tdb:unionDefaultGraph set to true. I start Fuseki with: /usr/bin/java -Dlog4j.configuration=log4j.properties -Xmx3200M -jar /opt/jena-2.10/jena-fuseki-0.2.8-SNAPSHOT/fuseki-server.jar --update --config=config-tdb-text.ttl --port=3131 If I add any data to the triple store, whether I put it in a named graph or not, and then attempt to query it without specifying a graph, I don't get any results. If I query with this: select * where { graph urn:x-arq:UnionGraph { ?s ?p ?o } } I do get results, which implies that the unionDefaultGraph option I set in my .ttl assembler isn't working correctly. Anyone have any ideas why the unionDefaultGraph capability isn't working? Thank you, Elli Elli, Thanks for the report. I've recorded this as JENA-477. I think I understand what is (or in this case, is not) going on. It's a design issue in that the query is executing over the dataset abstraction for text datasets, and so not deciding to use the TDB execution engine at the right granularity. Fix in progress. Elli, Fuseki build #38 should have fixes in it for this (there are changes in both ARQ and jena-text). Please let me know if it works as expected. Andy
jena-text with Lucene requires Solr?
Hello! trying to use jena-text with Lucene here. But it says ClassNotFoundException: org.apache.solr.client.solrj.SolrServer because it tries to load that in TextAssembler.init(). Is there a way to tell it that I don't even want to use Solr? Thanks! P.S. using Jena 2.10.2 with jean-text from: https://repository.apache.org/content/repositories/snapshots/org/apache/jena/jena-text/1.0.0-SNAPSHOT/jena-text-1.0.0-20130626.075943-23.jar
Re: jena-text with Lucene requires Solr?
On 26/06/13 15:15, tadum tada wrote: Hello! trying to use jena-text with Lucene here. But it says ClassNotFoundException: org.apache.solr.client.solrj.SolrServer because it tries to load that in TextAssembler.init(). Is there a way to tell it that I don't even want to use Solr? Thanks! That's the SolrJ, the clients-side interface - not the whole of Solr. As the POM says: dependency artifactIdsolr-solrj/artifactId groupIdorg.apache.solr/groupId version${ver.solr}/version exclusions exclusion groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId /exclusion exclusion groupIdorg.slf4j/groupId artifactIdslf4j-jdk14/artifactId /exclusion /exclusions /dependency Anything else from solr is scoped to test (use of embedded solr for testing). Andy P.S. using Jena 2.10.2 with jean-text from: https://repository.apache.org/content/repositories/snapshots/org/apache/jena/jena-text/1.0.0-SNAPSHOT/jena-text-1.0.0-20130626.075943-23.jar