This list is closed, nobody may subscribe to it.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(139) |
Aug
(94) |
Sep
(232) |
Oct
(143) |
Nov
(138) |
Dec
(55) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(127) |
Feb
(90) |
Mar
(101) |
Apr
(74) |
May
(148) |
Jun
(241) |
Jul
(169) |
Aug
(121) |
Sep
(157) |
Oct
(199) |
Nov
(281) |
Dec
(75) |
2012 |
Jan
(107) |
Feb
(122) |
Mar
(184) |
Apr
(73) |
May
(14) |
Jun
(49) |
Jul
(26) |
Aug
(103) |
Sep
(133) |
Oct
(61) |
Nov
(51) |
Dec
(55) |
2013 |
Jan
(59) |
Feb
(72) |
Mar
(99) |
Apr
(62) |
May
(92) |
Jun
(19) |
Jul
(31) |
Aug
(138) |
Sep
(47) |
Oct
(83) |
Nov
(95) |
Dec
(111) |
2014 |
Jan
(125) |
Feb
(60) |
Mar
(119) |
Apr
(136) |
May
(270) |
Jun
(83) |
Jul
(88) |
Aug
(30) |
Sep
(47) |
Oct
(27) |
Nov
(23) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <tho...@us...> - 2014-03-13 16:57:22
|
Revision: 7957 http://sourceforge.net/p/bigdata/code/7957 Author: thompsonbry Date: 2014-03-13 16:57:19 +0000 (Thu, 13 Mar 2014) Log Message: ----------- Examination of #853. Unable to replicate the problem. Ticket is closed. I did identify some problems with the ability to specify GET versus POST for a SPARQL QUERY. That issue has been fixed. I wrote unit tests which verify that POST and GET for a SPARQL QUERY are both allowed on the follower. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java 2014-03-13 16:21:32 UTC (rev 7956) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java 2014-03-13 16:57:19 UTC (rev 7957) @@ -49,6 +49,7 @@ import com.bigdata.ha.halog.IHALogReader; import com.bigdata.ha.msg.HARootBlockRequest; import com.bigdata.journal.AbstractJournal; +import com.bigdata.journal.jini.ha.AbstractHA3JournalServerTestCase.ABC; import com.bigdata.journal.jini.ha.HAJournalTest.HAGlueTest; import com.bigdata.quorum.Quorum; import com.bigdata.rdf.sail.webapp.client.RemoteRepository; @@ -3477,4 +3478,65 @@ } } + /** + * Test verifies that we can POST a SPARQL query to a follower. + * + * @see <a href="http://trac.bigdata.com/ticket/853"> Follower does not + * accept POST of idempotent operations (HA) </a> + */ + public void test_postQueryOnFollowers() throws Exception { + + final ABC abc = new ABC(false/*sequential*/); // simultaneous start. + + final HAGlue serverA = abc.serverA, serverB = abc.serverB, serverC = abc.serverC; + + // Verify quorum is FULLY met. + awaitFullyMetQuorum(); + + // await the KB create commit point to become visible on each service. + awaitCommitCounter(1L, new HAGlue[] { serverA, serverB, serverC }); + + // Verify binary equality of ALL journals. + assertDigestsEquals(new HAGlue[] { serverA, serverB, serverC }); + + final RemoteRepository[] repos = new RemoteRepository[3]; + repos[0] = getRemoteRepository(serverA); + repos[1] = getRemoteRepository(serverB); + repos[2] = getRemoteRepository(serverC); + + /* + * Verify that query on all nodes is allowed. + */ + for (RemoteRepository r : repos) { + + r.setQueryMethod("GET"); + + // Should be empty. + assertEquals(0L, + countResults(r.prepareTupleQuery("SELECT * {?a ?b ?c}") + .evaluate())); + + } + + // Change the maximum length of a GET for a Query. + for(RemoteRepository r : repos) { + + r.setMaxRequestURLLength(1); + + } + + // Run with the new length. All requests should be POSTs. + for (RemoteRepository r : repos) { + + r.setQueryMethod("POST"); + + // Should be empty. + assertEquals(0L, + countResults(r.prepareTupleQuery("SELECT * {?a ?b ?c}") + .evaluate())); + + } + + } + } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-13 16:21:32 UTC (rev 7956) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-13 16:57:19 UTC (rev 7957) @@ -141,15 +141,28 @@ static protected final String UTF8 = "UTF-8"; /** - * Note: The default is <code>false</code>. This supports use cases where - * the end points are read/write databases and http caching must be defeated - * in order to gain access to the most recent committed state of the end - * point. + * The name of the system property that may be used to specify the default + * HTTP method (GET or POST) for a SPARQL QUERY or other indempotent + * request. * + * @see #DEFAULT_QUERY_METHOD + * + * @see <a href="http://trac.bigdata.com/ticket/854"> Allow overrride of + * maximum length before converting an HTTP GET to an HTTP POST </a> + */ + static public final String QUERY_METHOD = RemoteRepository.class + .getName() + ".queryMethod"; + + /** + * Note: The default is {@value #DEFAULT_QUERY_METHOD}. This supports use + * cases where the end points are read/write databases and http caching must + * be defeated in order to gain access to the most recent committed state of + * the end point. + * * @see #getQueryMethod() * @see #setQueryMethod(String) */ - static private final String DEFAULT_QUERY_METHOD = "POST"; + static public final String DEFAULT_QUERY_METHOD = "POST"; /** * The name of the system property that may be used to specify the maximum @@ -159,7 +172,8 @@ * @see <a href="http://trac.bigdata.com/ticket/854"> Allow overrride of * maximum length before converting an HTTP GET to an HTTP POST </a> */ - static public final String MAX_REQUEST_URL_LENGTH = "maxRequestURLLength"; + static public final String MAX_REQUEST_URL_LENGTH = RemoteRepository.class + .getName() + ".maxRequestURLLength"; /** * The default maximum limit on a requestURL before the request is converted @@ -192,15 +206,13 @@ * The maximum requestURL length before the request is converted into a POST * using a <code>application/x-www-form-urlencoded</code> request entity. */ - private volatile int maxRequestURLLength = Integer.parseInt(System - .getProperty(MAX_REQUEST_URL_LENGTH, - Integer.toString(DEFAULT_MAX_REQUEST_URL_LENGTH))); + private volatile int maxRequestURLLength; /** * The HTTP verb that will be used for a QUERY (versus a UPDATE or other * mutation operation). */ - private volatile String queryMethod = DEFAULT_QUERY_METHOD; + private volatile String queryMethod; /** * Return the maximum requestURL length before the request is converted into @@ -228,7 +240,7 @@ /** * Return the HTTP verb that will be used for a QUERY (versus an UPDATE or - * other mutation operations) (default {@value #DEFAULT_IS_GET}). POST can + * other mutation operations) (default {@value #DEFAULT_QUERY_METHOD}). POST can * often handle larger queries than GET due to limits at the HTTP client * layer and will defeat http caching and thus provide a current view of the * committed state of the SPARQL end point when the end point is a @@ -312,6 +324,12 @@ this.executor = executor; + setMaxRequestURLLength(Integer.parseInt(System.getProperty( + MAX_REQUEST_URL_LENGTH, + Integer.toString(DEFAULT_MAX_REQUEST_URL_LENGTH)))); + + setQueryMethod(System.getProperty(QUERY_METHOD, DEFAULT_QUERY_METHOD)); + } @Override @@ -971,7 +989,7 @@ */ protected void setupConnectOptions() { - opts.method = "POST"; + opts.method = getQueryMethod(); if(update) { Modified: branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java =================================================================== --- branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java 2014-03-13 16:21:32 UTC (rev 7956) +++ branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java 2014-03-13 16:57:19 UTC (rev 7957) @@ -3477,4 +3477,65 @@ } } + /** + * Test verifies that we can POST a SPARQL query to a follower. + * + * @see <a href="http://trac.bigdata.com/ticket/853"> Follower does not + * accept POST of idempotent operations (HA) </a> + */ + public void test_postQueryOnFollowers() throws Exception { + + final ABC abc = new ABC(false/*sequential*/); // simultaneous start. + + final HAGlue serverA = abc.serverA, serverB = abc.serverB, serverC = abc.serverC; + + // Verify quorum is FULLY met. + awaitFullyMetQuorum(); + + // await the KB create commit point to become visible on each service. + awaitCommitCounter(1L, new HAGlue[] { serverA, serverB, serverC }); + + // Verify binary equality of ALL journals. + assertDigestsEquals(new HAGlue[] { serverA, serverB, serverC }); + + final RemoteRepository[] repos = new RemoteRepository[3]; + repos[0] = getRemoteRepository(serverA); + repos[1] = getRemoteRepository(serverB); + repos[2] = getRemoteRepository(serverC); + + /* + * Verify that query on all nodes is allowed. + */ + for (RemoteRepository r : repos) { + + r.setQueryMethod("GET"); + + // Should be empty. + assertEquals(0L, + countResults(r.prepareTupleQuery("SELECT * {?a ?b ?c}") + .evaluate())); + + } + + // Change the maximum length of a GET for a Query. + for(RemoteRepository r : repos) { + + r.setMaxRequestURLLength(1); + + } + + // Run with the new length. All requests should be POSTs. + for (RemoteRepository r : repos) { + + r.setQueryMethod("POST"); + + // Should be empty. + assertEquals(0L, + countResults(r.prepareTupleQuery("SELECT * {?a ?b ?c}") + .evaluate())); + + } + + } + } Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-13 16:21:32 UTC (rev 7956) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-13 16:57:19 UTC (rev 7957) @@ -141,15 +141,28 @@ static protected final String UTF8 = "UTF-8"; /** - * Note: The default is <code>false</code>. This supports use cases where - * the end points are read/write databases and http caching must be defeated - * in order to gain access to the most recent committed state of the end - * point. + * The name of the system property that may be used to specify the default + * HTTP method (GET or POST) for a SPARQL QUERY or other indempotent + * request. * + * @see #DEFAULT_QUERY_METHOD + * + * @see <a href="http://trac.bigdata.com/ticket/854"> Allow overrride of + * maximum length before converting an HTTP GET to an HTTP POST </a> + */ + static public final String QUERY_METHOD = RemoteRepository.class + .getName() + ".queryMethod"; + + /** + * Note: The default is {@value #DEFAULT_QUERY_METHOD}. This supports use + * cases where the end points are read/write databases and http caching must + * be defeated in order to gain access to the most recent committed state of + * the end point. + * * @see #getQueryMethod() * @see #setQueryMethod(String) */ - static private final String DEFAULT_QUERY_METHOD = "POST"; + static public final String DEFAULT_QUERY_METHOD = "POST"; /** * The name of the system property that may be used to specify the maximum @@ -159,7 +172,8 @@ * @see <a href="http://trac.bigdata.com/ticket/854"> Allow overrride of * maximum length before converting an HTTP GET to an HTTP POST </a> */ - static public final String MAX_REQUEST_URL_LENGTH = "maxRequestURLLength"; + static public final String MAX_REQUEST_URL_LENGTH = RemoteRepository.class + .getName() + ".maxRequestURLLength"; /** * The default maximum limit on a requestURL before the request is converted @@ -192,15 +206,13 @@ * The maximum requestURL length before the request is converted into a POST * using a <code>application/x-www-form-urlencoded</code> request entity. */ - private volatile int maxRequestURLLength = Integer.parseInt(System - .getProperty(MAX_REQUEST_URL_LENGTH, - Integer.toString(DEFAULT_MAX_REQUEST_URL_LENGTH))); + private volatile int maxRequestURLLength; /** * The HTTP verb that will be used for a QUERY (versus a UPDATE or other * mutation operation). */ - private volatile String queryMethod = DEFAULT_QUERY_METHOD; + private volatile String queryMethod; /** * Return the maximum requestURL length before the request is converted into @@ -228,7 +240,7 @@ /** * Return the HTTP verb that will be used for a QUERY (versus an UPDATE or - * other mutation operations) (default {@value #DEFAULT_IS_GET}). POST can + * other mutation operations) (default {@value #DEFAULT_QUERY_METHOD}). POST can * often handle larger queries than GET due to limits at the HTTP client * layer and will defeat http caching and thus provide a current view of the * committed state of the SPARQL end point when the end point is a @@ -312,6 +324,12 @@ this.executor = executor; + setMaxRequestURLLength(Integer.parseInt(System.getProperty( + MAX_REQUEST_URL_LENGTH, + Integer.toString(DEFAULT_MAX_REQUEST_URL_LENGTH)))); + + setQueryMethod(System.getProperty(QUERY_METHOD, DEFAULT_QUERY_METHOD)); + } @Override @@ -1017,7 +1035,7 @@ */ protected void setupConnectOptions() { - opts.method = "POST"; + opts.method = getQueryMethod(); if(update) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-13 16:21:36
|
Revision: 7956 http://sourceforge.net/p/bigdata/code/7956 Author: thompsonbry Date: 2014-03-13 16:21:32 +0000 (Thu, 13 Mar 2014) Log Message: ----------- Bug fix for the RemoteRepository. - http://trac.bigdata.com/ticket/854 (Allow override of maximum length before converting an HTTP GET to an HTTP POST) - http://trac.bigdata.com/ticket/852 (RemoteRepository.cancel() does not consume the HTTP response entity) Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-13 15:52:26 UTC (rev 7955) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-13 16:21:32 UTC (rev 7956) @@ -152,6 +152,16 @@ static private final String DEFAULT_QUERY_METHOD = "POST"; /** + * The name of the system property that may be used to specify the maximum + * length (in characters) for a requestURL associated with an HTTP GET + * before it is automatically converted to an HTTP POST. + * + * @see <a href="http://trac.bigdata.com/ticket/854"> Allow overrride of + * maximum length before converting an HTTP GET to an HTTP POST </a> + */ + static public final String MAX_REQUEST_URL_LENGTH = "maxRequestURLLength"; + + /** * The default maximum limit on a requestURL before the request is converted * into a POST using a <code>application/x-www-form-urlencoded</code> * request entity. @@ -182,7 +192,9 @@ * The maximum requestURL length before the request is converted into a POST * using a <code>application/x-www-form-urlencoded</code> request entity. */ - private volatile int maxRequestURLLength = DEFAULT_MAX_REQUEST_URL_LENGTH; + private volatile int maxRequestURLLength = Integer.parseInt(System + .getProperty(MAX_REQUEST_URL_LENGTH, + Integer.toString(DEFAULT_MAX_REQUEST_URL_LENGTH))); /** * The HTTP verb that will be used for a QUERY (versus a UPDATE or other @@ -538,7 +550,20 @@ opts.addRequestParam("queryId", queryId.toString()); - checkResponseCode(doConnect(opts)); + HttpResponse response = null; + try { + // Issue request, check response status code. + checkResponseCode(response = doConnect(opts)); + } finally { + /* + * Ensure that the http response entity is consumed so that the http + * connection will be released in a timely fashion. + */ + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException ex) { + } + } } Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-13 15:52:26 UTC (rev 7955) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-13 16:21:32 UTC (rev 7956) @@ -150,6 +150,16 @@ * @see #setQueryMethod(String) */ static private final String DEFAULT_QUERY_METHOD = "POST"; + + /** + * The name of the system property that may be used to specify the maximum + * length (in characters) for a requestURL associated with an HTTP GET + * before it is automatically converted to an HTTP POST. + * + * @see <a href="http://trac.bigdata.com/ticket/854"> Allow overrride of + * maximum length before converting an HTTP GET to an HTTP POST </a> + */ + static public final String MAX_REQUEST_URL_LENGTH = "maxRequestURLLength"; /** * The default maximum limit on a requestURL before the request is converted @@ -161,7 +171,7 @@ * having a request URL that is 2000 characters long should go through with * a GET. 1000 is a safe value but it could reduce http caching. */ - static private final int DEFAULT_MAX_REQUEST_URL_LENGTH = 1000; + static public final int DEFAULT_MAX_REQUEST_URL_LENGTH = 1000; /** * The service end point for the default data set. @@ -182,7 +192,9 @@ * The maximum requestURL length before the request is converted into a POST * using a <code>application/x-www-form-urlencoded</code> request entity. */ - private volatile int maxRequestURLLength = DEFAULT_MAX_REQUEST_URL_LENGTH; + private volatile int maxRequestURLLength = Integer.parseInt(System + .getProperty(MAX_REQUEST_URL_LENGTH, + Integer.toString(DEFAULT_MAX_REQUEST_URL_LENGTH))); /** * The HTTP verb that will be used for a QUERY (versus a UPDATE or other @@ -584,7 +596,20 @@ opts.addRequestParam("queryId", queryId.toString()); - checkResponseCode(doConnect(opts)); + HttpResponse response = null; + try { + // Issue request, check response status code. + checkResponseCode(response = doConnect(opts)); + } finally { + /* + * Ensure that the http response entity is consumed so that the http + * connection will be released in a timely fashion. + */ + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException ex) { + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-13 15:52:32
|
Revision: 7955 http://sourceforge.net/p/bigdata/code/7955 Author: thompsonbry Date: 2014-03-13 15:52:26 +0000 (Thu, 13 Mar 2014) Log Message: ----------- Removed the jetty 7.2.2 artifacts. See #730 (jetty configuration). Removed Paths: ------------- branches/RDR/bigdata/lib/jetty/jetty-continuation-7.2.2.v20101205.jar branches/RDR/bigdata/lib/jetty/jetty-http-7.2.2.v20101205.jar branches/RDR/bigdata/lib/jetty/jetty-io-7.2.2.v20101205.jar branches/RDR/bigdata/lib/jetty/jetty-rewrite-7.2.2.v20101205.jar branches/RDR/bigdata/lib/jetty/jetty-security-7.2.2.v20101205.jar branches/RDR/bigdata/lib/jetty/jetty-server-7.2.2.v20101205.jar branches/RDR/bigdata/lib/jetty/jetty-servlet-7.2.2.v20101205.jar branches/RDR/bigdata/lib/jetty/jetty-util-7.2.2.v20101205.jar branches/RDR/bigdata/lib/jetty/jetty-webapp-7.2.2.v20101205.jar branches/RDR/bigdata/lib/jetty/jetty-xml-7.2.2.v20101205.jar Deleted: branches/RDR/bigdata/lib/jetty/jetty-continuation-7.2.2.v20101205.jar =================================================================== (Binary files differ) Deleted: branches/RDR/bigdata/lib/jetty/jetty-http-7.2.2.v20101205.jar =================================================================== (Binary files differ) Deleted: branches/RDR/bigdata/lib/jetty/jetty-io-7.2.2.v20101205.jar =================================================================== (Binary files differ) Deleted: branches/RDR/bigdata/lib/jetty/jetty-rewrite-7.2.2.v20101205.jar =================================================================== (Binary files differ) Deleted: branches/RDR/bigdata/lib/jetty/jetty-security-7.2.2.v20101205.jar =================================================================== (Binary files differ) Deleted: branches/RDR/bigdata/lib/jetty/jetty-server-7.2.2.v20101205.jar =================================================================== (Binary files differ) Deleted: branches/RDR/bigdata/lib/jetty/jetty-servlet-7.2.2.v20101205.jar =================================================================== (Binary files differ) Deleted: branches/RDR/bigdata/lib/jetty/jetty-util-7.2.2.v20101205.jar =================================================================== (Binary files differ) Deleted: branches/RDR/bigdata/lib/jetty/jetty-webapp-7.2.2.v20101205.jar =================================================================== (Binary files differ) Deleted: branches/RDR/bigdata/lib/jetty/jetty-xml-7.2.2.v20101205.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-13 15:51:45
|
Revision: 7954 http://sourceforge.net/p/bigdata/code/7954 Author: thompsonbry Date: 2014-03-13 15:51:39 +0000 (Thu, 13 Mar 2014) Log Message: ----------- - I have changed the dependency to jetty 9.1. I have also brought in the jetty-proxy jar in anticipation of using the ProxyServlet to support transparent load balancing. This required several changes to jetty.xml. - I have eliminated the code paths in the NanoSparqlServer that relied on manual configuration (in code) of the NSS. All code paths now rely on jetty.xml and web.xml, even for embedded use. You can override the location of the jetty.xml file if necessary to customize the deployment. You can also override properties in jetty.xml using environment variables and init parameters in web.xml using the NSS command line options. Note: It appears to be impossible to override the init parameters set on a WebAppContext that is configured from a web.xml file. This appears to be in accordance with the Servlet 3.0 specification. To work around this, I attach the overrides for the init parameters as an attribute to the WebAppContext. The life cycle listener then consults both the init parameters from web.xml and those from the overrides and generates a map of the effective init parameters. This is done in BigdataRDFServletContextListener. There is also a new unit test to verify that we can override these parameters. This is TestNanoSparqlServer. - I added an override for the resourceBase for jetty as deployed for the HA CI test suite. - The InferenceServlet has been entered into web.xml so it should continue to function (are there unit tests for this yet?). - done: test CI (GOM, HA) - done: test NSS command line script startup (tests for ability to find the embedded web.xml file in the compiled JAR). The jetty.xml file is located in bigdata-war/src/jetty.xml. This file is in the jar, but it is not located in that position since it is looking for jetty.xml. To run the NSS, you need to override the location using "-DjettyXml=bigdata-war/src/jetty.xml" or any other jetty.xml file that you want to use. I added a "-jettyXml" option to the NSS main() routine and set the default to locate the jetty.xml resource inside of the jar (bigdata-war/src/jetty.xml). - done: test distribution (HA service starter) {{{ # Laptop setup. cd /Users/bryan/Documents/workspace/RDR_NEW_SVN #svn update ant clean stage export wd=/Users/bryan/Documents/workspace/RDR_NEW_SVN export FEDNAME=benchmark3 export LOGICAL_SERVICE_ID=HAJournal-1 export FED_DIR=$wd export LOCATORS="jini://localhost" export ZK_SERVERS="localhost:2081" export JETTY_XML=${wd}/dist/bigdata/var/jetty/jetty.xml export JETTY_WEB_XML=${wd}/dist/bigdata/var/jetty/WEB-INF/web.xml export JETTY_PORT=8090 dist/bigdata/bin/startHAServices tail -f HAJournalServer.log | egrep '(ERROR|WARN|FATAL)' }}} - done: test WAR See #730 (jetty.xml configuration) Modified Paths: -------------- branches/RDR/.classpath branches/RDR/bigdata-gom/src/test/com/bigdata/gom/RemoteGOMTestCase.java branches/RDR/bigdata-gom/src/test/com/bigdata/gom/TestRemoteGOM.java branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFServletContextListener.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java branches/RDR/bigdata-sails/src/samples/com/bigdata/samples/NSSEmbeddedExample.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractNanoSparqlServerTestCase.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractTestNanoSparqlClient.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestAll.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestFederatedQuery.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlServerWithProxyIndexManager.java branches/RDR/bigdata-war/src/WEB-INF/web.xml branches/RDR/bigdata-war/src/jetty.xml branches/RDR/build.properties branches/RDR/build.xml branches/RDR/pom.xml Added Paths: ----------- branches/RDR/LEGAL/ branches/RDR/LEGAL/apache-license-2_0.txt branches/RDR/LEGAL/sesame2.x-license.txt branches/RDR/bigdata/lib/jetty/jetty-continuation-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/jetty-http-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/jetty-io-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/jetty-proxy-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/jetty-rewrite-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/jetty-security-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/jetty-server-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/jetty-servlet-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/jetty-util-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/jetty-webapp-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/jetty-xml-9.1.3.v20140225.jar branches/RDR/bigdata/lib/jetty/servlet-api-3.1.0.jar branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlServer.java Modified: branches/RDR/.classpath =================================================================== --- branches/RDR/.classpath 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/.classpath 2014-03-13 15:51:39 UTC (rev 7954) @@ -32,18 +32,9 @@ <classpathentry kind="src" path="bigdata-gas/src/java"/> <classpathentry kind="src" path="bigdata-gas/src/test"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/dsi-utils-1.0.6-020610.jar"/> - <classpathentry kind="lib" path="bigdata/lib/lgpl-utils-1.0.7-270114.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/lgpl-utils-1.0.7-270114.jar"/> <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/apache/zookeeper-3.3.3.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-continuation-7.2.2.v20101205.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-http-7.2.2.v20101205.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-io-7.2.2.v20101205.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-server-7.2.2.v20101205.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-util-7.2.2.v20101205.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/servlet-api-2.5.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-servlet-7.2.2.v20101205.jar" sourcepath="/Users/bryan/Downloads/jetty-hightide-7.2.2.v20101205-src"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-security-7.2.2.v20101205.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-webapp-7.2.2.v20101205.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-xml-7.2.2.v20101205.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/servlet-api-3.1.0.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/colt-1.2.0.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-4.8.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-charset-4.8.jar"/> @@ -67,7 +58,6 @@ <classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/fastutil-5.1.5.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/lucene/lucene-analyzers-3.0.0.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/lucene/lucene-core-3.0.0.jar"/> - <classpathentry kind="lib" path="bigdata/lib/jetty/jetty-rewrite-7.2.2.v20101205.jar"/> <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/high-scale-lib-v1.1.2.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/junit-ext-1.1-b3-dev.jar"/> @@ -87,5 +77,16 @@ <classpathentry exported="true" kind="lib" path="bigdata-sails/lib/sesame-sparql-testsuite-2.6.10.jar"/> <classpathentry exported="true" kind="lib" path="bigdata-sails/lib/sesame-store-testsuite-2.6.10.jar"/> <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/nxparser-1.2.3.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-continuation-9.1.3.v20140225.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-http-9.1.3.v20140225.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-io-9.1.3.v20140225.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-proxy-9.1.3.v20140225.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-rewrite-9.1.3.v20140225.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-security-9.1.3.v20140225.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-server-9.1.3.v20140225.jar" sourcepath="/Users/bryan/Documents/workspace/org.eclipse.jetty.project-jetty-9.1-wsbatch"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-servlet-9.1.3.v20140225.jar" sourcepath="/Users/bryan/Documents/workspace/org.eclipse.jetty.project-jetty-9.1-wsbatch"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-util-9.1.3.v20140225.jar" sourcepath="/Users/bryan/Documents/workspace/org.eclipse.jetty.project-jetty-9.1-wsbatch"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-webapp-9.1.3.v20140225.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-xml-9.1.3.v20140225.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Added: branches/RDR/LEGAL/apache-license-2_0.txt =================================================================== --- branches/RDR/LEGAL/apache-license-2_0.txt (rev 0) +++ branches/RDR/LEGAL/apache-license-2_0.txt 2014-03-13 15:51:39 UTC (rev 7954) @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Property changes on: branches/RDR/LEGAL/apache-license-2_0.txt ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: branches/RDR/LEGAL/sesame2.x-license.txt =================================================================== --- branches/RDR/LEGAL/sesame2.x-license.txt (rev 0) +++ branches/RDR/LEGAL/sesame2.x-license.txt 2014-03-13 15:51:39 UTC (rev 7954) @@ -0,0 +1,25 @@ +Copyright Aduna (http://www.aduna-software.com/) \xA9 2001-2007 +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Property changes on: branches/RDR/LEGAL/sesame2.x-license.txt ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-continuation-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-continuation-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-continuation-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-continuation-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-continuation-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-http-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-http-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-http-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-http-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-http-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-io-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-io-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-io-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-io-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-io-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-proxy-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-proxy-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-proxy-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-proxy-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-proxy-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-rewrite-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-rewrite-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-rewrite-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-rewrite-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-rewrite-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-security-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-security-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-security-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-security-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-security-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-server-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-server-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-server-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-server-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-server-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-servlet-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-servlet-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-servlet-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-servlet-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-servlet-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-util-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-util-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-util-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-util-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-util-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-webapp-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-webapp-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-webapp-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-webapp-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-webapp-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/jetty-xml-9.1.3.v20140225.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-xml-9.1.3.v20140225.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-xml-9.1.3.v20140225.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/jetty-xml-9.1.3.v20140225.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-xml-9.1.3.v20140225.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: branches/RDR/bigdata/lib/jetty/servlet-api-3.1.0.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/servlet-api-3.1.0.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/servlet-api-3.1.0.jar 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata/lib/jetty/servlet-api-3.1.0.jar 2014-03-13 15:51:39 UTC (rev 7954) Property changes on: branches/RDR/bigdata/lib/jetty/servlet-api-3.1.0.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: branches/RDR/bigdata-gom/src/test/com/bigdata/gom/RemoteGOMTestCase.java =================================================================== --- branches/RDR/bigdata-gom/src/test/com/bigdata/gom/RemoteGOMTestCase.java 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata-gom/src/test/com/bigdata/gom/RemoteGOMTestCase.java 2014-03-13 15:51:39 UTC (rev 7954) @@ -30,11 +30,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.PrintWriter; import java.io.Reader; import java.net.URL; -import java.net.URLConnection; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.util.Properties; @@ -47,20 +44,14 @@ import org.apache.http.impl.client.DefaultHttpClient; import org.apache.log4j.Logger; import org.eclipse.jetty.server.Server; -import org.openrdf.model.Resource; -import org.openrdf.model.URI; import org.openrdf.model.ValueFactory; import org.openrdf.repository.RepositoryException; import org.openrdf.rio.RDFFormat; import org.openrdf.rio.RDFParseException; import com.bigdata.BigdataStatics; -import com.bigdata.gom.gpo.IGPO; -import com.bigdata.gom.gpo.ILinkSet; import com.bigdata.gom.om.IObjectManager; import com.bigdata.gom.om.NanoSparqlObjectManager; -import com.bigdata.gom.om.ObjectManager; -import com.bigdata.gom.om.ObjectMgrModel; import com.bigdata.journal.BufferMode; import com.bigdata.journal.IIndexManager; import com.bigdata.journal.ITx; @@ -193,7 +184,7 @@ m_server.start(); - final int port = m_server.getConnectors()[0].getLocalPort(); + final int port = NanoSparqlServer.getLocalPort(m_server); final String hostAddr = NicUtil.getIpAddress("default.nic", "default", true/* loopbackOk */); Modified: branches/RDR/bigdata-gom/src/test/com/bigdata/gom/TestRemoteGOM.java =================================================================== --- branches/RDR/bigdata-gom/src/test/com/bigdata/gom/TestRemoteGOM.java 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata-gom/src/test/com/bigdata/gom/TestRemoteGOM.java 2014-03-13 15:51:39 UTC (rev 7954) @@ -163,7 +163,7 @@ m_server.start(); - final int port = m_server.getConnectors()[0].getLocalPort(); + final int port = NanoSparqlServer.getLocalPort(m_server); final String hostAddr = NicUtil.getIpAddress("default.nic", "default", true/* loopbackOk */); Modified: branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java =================================================================== --- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-03-13 15:51:39 UTC (rev 7954) @@ -449,7 +449,7 @@ * * @see #DEFAULT_JETTY_XML */ - String JETTY_XML = "jettyXml"; + String JETTY_XML = NanoSparqlServer.SystemProperties.JETTY_XML; /** * The default value works when deployed under the IDE with the @@ -457,7 +457,7 @@ * deploying outside of that context, the value needs to be set * explicitly. */ - String DEFAULT_JETTY_XML = "jetty.xml"; + String DEFAULT_JETTY_XML = NanoSparqlServer.SystemProperties.DEFAULT_JETTY_XML; } @@ -4576,7 +4576,8 @@ // } // Setup the embedded jetty server for NSS webapp. - jettyServer = NanoSparqlServer.newInstance(jettyXml, journal); + jettyServer = NanoSparqlServer + .newInstance(jettyXml, journal, null/* initParams */); // } @@ -4659,13 +4660,8 @@ */ int getNSSPort() { - final Server tmp = jettyServer; + return NanoSparqlServer.getLocalPort(jettyServer); - if (tmp == null) - throw new IllegalStateException("Server is not running"); - - return tmp.getConnectors()[0].getLocalPort(); - } /** Modified: branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java =================================================================== --- branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-03-13 15:51:39 UTC (rev 7954) @@ -2173,6 +2173,14 @@ * connection. */ private final String TEST_JETTY_PORT = "jetty.port"; + + /** + * The path in the local file system to the root of the web + * application. This is <code>bigdata-war/src</code> in the source + * code, but the webapp gets deployed to the serviceDir for this + * test suite. + */ + private final String JETTY_RESOURCE_BASE = "jetty.resourceBase"; /** * The absolute effective path of the service directory. This is @@ -2216,8 +2224,12 @@ cmds.add("-D" + TEST_LOGICAL_SERVICE_ID + "=" + getLogicalServiceId()); + // Override the HTTP port for jetty. cmds.add("-D" + TEST_JETTY_PORT + "=" + jettyPort); + // Override the location of the webapp as deployed. + cmds.add("-D" + JETTY_RESOURCE_BASE + "=\".\""); + super.addCommandArgs(cmds); for (String arg : args) { Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFServletContextListener.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFServletContextListener.java 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFServletContextListener.java 2014-03-13 15:51:39 UTC (rev 7954) @@ -29,10 +29,14 @@ import java.io.BufferedInputStream; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; import java.util.Date; +import java.util.Enumeration; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.Properties; import javax.servlet.ServletContext; @@ -40,6 +44,7 @@ import javax.servlet.ServletContextListener; import org.apache.log4j.Logger; +import org.eclipse.jetty.webapp.WebAppContext; import com.bigdata.Banner; import com.bigdata.bop.engine.QueryEngine; @@ -83,6 +88,13 @@ private long readLockTx; private BigdataRDFContext rdfContext; // private SparqlCache sparqlCache; + + /** + * The set of init parameters from the <code>web.xml</code> file after we + * have applied any overrides specified by the + * {@link BigdataRDFServletContextListener#INIT_PARAM_OVERRIDES} attributes. + */ + private Map<String,String> effectiveInitParams; /** * <code>true</code> iff this class opened the {@link IIndexManager}, in @@ -90,6 +102,33 @@ */ private boolean closeIndexManager; + /** + * The name of the {@link WebAppContext} attribute under which we store any + * overrides for the init parameters of the {@link WebAppContext}. Note that + * it is NOT possible to actual modify the init parameters specified in the + * <code>web.xml</code> file. Therefore, we attach the overrides as an + * attribute and then consult them from within + * {@link BigdataRDFServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)} + * . + */ + public static final String INIT_PARAM_OVERRIDES = "INIT_PARAMS_OVERRIDES"; + + /** + * Return the effective value of the given init parameter, respecting any + * overrides that were specified to the {@link NanoSparqlServer} when it + * initialized the server. + * + * @param key + * The name of the desired init parameter. + * + * @return The effective value of that init parameter. + */ + protected String getInitParameter(final String key) { + + return effectiveInitParams.get(key); + + } + public BigdataRDFServletContextListener() { super(); } @@ -110,10 +149,50 @@ final ServletContext context = e.getServletContext(); + /* + * Figure out the effective init parameters that we want to use + * for this initialization procedure. + */ + { + + effectiveInitParams = new LinkedHashMap<String, String>(); + + /* + * Copy the init params from web.xml into a local map. + */ + final Enumeration<String> names = context.getInitParameterNames(); + while(names.hasMoreElements()) { + final String name = names.nextElement(); + final String value = context.getInitParameter(name); + effectiveInitParams.put(name, value); + } + + /* + * Look for init parameter overrides that have been attached to the + * WebAppContext by the NanoSparqlServer. If found, then apply them + * before doing anything else. This is how we apply overrides to the + * init parameters that were specified in "web.xml". + */ + { + + @SuppressWarnings("unchecked") + final Map<String, String> initParamOverrides = (Map<String, String>) context + .getAttribute(BigdataRDFServletContextListener.INIT_PARAM_OVERRIDES); + + if (initParamOverrides != null) { + + effectiveInitParams.putAll(initParamOverrides); + + } + + } + + } + final String namespace; { - String s = context.getInitParameter(ConfigParams.NAMESPACE); + String s = getInitParameter(ConfigParams.NAMESPACE); if (s == null) s = ConfigParams.DEFAULT_NAMESPACE; @@ -128,7 +207,7 @@ final boolean create; { - final String s = context.getInitParameter(ConfigParams.CREATE); + final String s = getInitParameter(ConfigParams.CREATE); if (s != null) create = Boolean.valueOf(s); @@ -170,9 +249,9 @@ + ConfigParams.PROPERTY_FILE; // The default value is taken from the web.xml file. - final String defaultValue = context - .getInitParameter(ConfigParams.PROPERTY_FILE); - + final String defaultValue = getInitParameter( + ConfigParams.PROPERTY_FILE); + // The effective location of the property file. final String propertyFile = System.getProperty(// FQN_PROPERTY_FILE,// @@ -213,7 +292,7 @@ final long timestamp; { - final String s = context.getInitParameter(ConfigParams.READ_LOCK); + final String s = getInitParameter( ConfigParams.READ_LOCK); readLock = s == null ? null : Long.valueOf(s); @@ -257,8 +336,7 @@ final int queryThreadPoolSize; { - final String s = context - .getInitParameter(ConfigParams.QUERY_THREAD_POOL_SIZE); + final String s = getInitParameter( ConfigParams.QUERY_THREAD_POOL_SIZE); queryThreadPoolSize = s == null ? ConfigParams.DEFAULT_QUERY_THREAD_POOL_SIZE : Integer.valueOf(s); @@ -279,8 +357,7 @@ final boolean describeEachNamedGraph; { - final String s = context - .getInitParameter(ConfigParams.DESCRIBE_EACH_NAMED_GRAPH); + final String s = getInitParameter( ConfigParams.DESCRIBE_EACH_NAMED_GRAPH); describeEachNamedGraph = s == null ? ConfigParams.DEFAULT_DESCRIBE_EACH_NAMED_GRAPH : Boolean.valueOf(s); @@ -294,7 +371,7 @@ final boolean readOnly; { - final String s = context.getInitParameter(ConfigParams.READ_ONLY); + final String s = getInitParameter( ConfigParams.READ_ONLY); readOnly = s == null ? ConfigParams.DEFAULT_READ_ONLY : Boolean .valueOf(s); @@ -307,8 +384,7 @@ final long queryTimeout; { - final String s = context - .getInitParameter(ConfigParams.QUERY_TIMEOUT); + final String s = getInitParameter( ConfigParams.QUERY_TIMEOUT); queryTimeout = s == null ? ConfigParams.DEFAULT_QUERY_TIMEOUT : Integer.valueOf(s); @@ -356,8 +432,8 @@ { - final boolean forceOverflow = Boolean.valueOf(context - .getInitParameter(ConfigParams.FORCE_OVERFLOW)); + final boolean forceOverflow = Boolean + .valueOf(getInitParameter(ConfigParams.FORCE_OVERFLOW)); if (forceOverflow && indexManager instanceof IBigdataFederation<?>) { @@ -414,6 +490,10 @@ + readLockTx, ex); } + + txs = null; + readLock = null; + } if (jnl != null) { @@ -442,6 +522,8 @@ // sparqlCache = null; // // } + + effectiveInitParams = null; /* * Terminate various threads which should no longer be executing once we @@ -469,15 +551,37 @@ */ private IIndexManager openIndexManager(final String propertyFile) { - final File file = new File(propertyFile); + // Locate the named .properties or .config file. + final URL propertyFileUrl; + if (new File(propertyFile).exists()) { - if (!file.exists()) { + // Check the file system. + try { + propertyFileUrl = new URL("file:" + propertyFile); + } catch (MalformedURLException ex) { + throw new RuntimeException(ex); + } - throw new RuntimeException("Could not find file: file=" + file - + ", user.dir=" + System.getProperty("user.dir")); + } else { + // Check the classpath. + propertyFileUrl = BigdataRDFServletContextListener.class + .getClassLoader().getResource(propertyFile); + } + if (log.isInfoEnabled()) + log.info("bigdata configuration: propertyFile=" + propertyFile + + ", propertyFileUrl=" + propertyFileUrl); + + if (propertyFileUrl == null) { + + throw new RuntimeException("Could not find file: file=" + + propertyFile + ", user.dir=" + + System.getProperty("user.dir")); + + } + boolean isJini = false; if (propertyFile.endsWith(".config")) { // scale-out. @@ -493,7 +597,7 @@ */ throw new RuntimeException( "File must have '.config' or '.properties' extension: " - + file); + + propertyFile); } final IIndexManager indexManager; @@ -503,6 +607,16 @@ /* * A bigdata federation. + * + * Note: The Apache River configuration mechanism will search + * both the file system and the classpath, much as we have done + * above. + * + * TODO This will use the ClassLoader associated with the + * JiniClient if that is different from the ClassLoader used + * above, then it could be possible for one ClassLoader to find + * the propertyFile resource and the other to not find that + * resource. */ jiniClient = new JiniClient(new String[] { propertyFile }); @@ -522,7 +636,7 @@ { // Read the properties from the file. final InputStream is = new BufferedInputStream( - new FileInputStream(propertyFile)); + propertyFileUrl.openStream()); try { properties.load(is); } finally { Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-13 13:55:47 UTC (rev 7953) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-13 15:51:39 UTC (rev 7954) @@ -32,25 +32,19 @@ import javax.servlet.ServletContextListener; import org.apache.log4j.Logger; -import org.eclipse.jetty.server.Handler; +import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.server.handler.ResourceHandler; -import org.eclipse.jetty.servlet.DefaultServlet; -import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.servlet.ServletHolder; +import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.xml.XmlConfiguration; import com.bigdata.Banner; -import com.bigdata.BigdataStatics; import com.bigdata.journal.IIndexManager; import com.bigdata.journal.ITx; import com.bigdata.journal.Journal; import com.bigdata.journal.TimestampUtility; +import com.bigdata.resources.IndexManager; import com.bigdata.util.config.NicUtil; /** @@ -109,6 +103,37 @@ static private final Logger log = Logger.getLogger(NanoSparqlServer.class); + public interface SystemProperties { + + /** + * The name of the system property that can be used to override the default + * HTTP port in the bundled <code>jetty.xml</code> file. + */ + String JETTY_PORT = "jetty.port"; + + /** + * The name of the system property that can be used to override the + * location of the <code>jetty.xml</code> file that will be used to + * configure jetty (default {@value #DEFAULT_JETTY_XML}). + * + * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/730" > + * Allow configuration of embedded NSS jetty server using + * jetty-web.xml </a> + * + * @see #DEFAULT_JETTY_XML + */ + String JETTY_XML = "jettyXml"; + + /** + * The default value works when deployed under the IDE with the + * <code>bigdata-war/src</code> directory on the classpath. When + * deploying outside of that context, the value needs to be set + * explicitly. + */ + String DEFAULT_JETTY_XML = "jetty.xml"; + + } + /** * Run an httpd service exposing a SPARQL endpoint. The service will respond * to the following URL paths: @@ -145,6 +170,16 @@ * </dl> * and <i>options</i> are any of: * <dl> + * <dt>-jettyXml</dt> + * <dd>The location of the jetty.xml resource that will be used + * to start the {@link Server} (default is the file in the JAR). + * * The default will locate the <code>jetty.xml</code> resource + * that is bundled with the JAR. This preserves the historical + * behavior. If you want to use a different + * <code>jetty.xml</code> file, just override this property on + * the command line -or- specify the + * {@link NanoSparqlServer.SystemProperties#JETTY_XML} system + * property.</dd> * <dt>-nthreads</dt> * <dd>The #of threads which will be used to answer SPARQL * queries (default @@ -184,6 +219,14 @@ boolean forceOverflow = false; Long readLock = null; String servletContextListenerClass = ConfigParams.DEFAULT_SERVLET_CONTEXT_LISTENER_CLASS; + + /* + * Note: This default will locate the jetty.xml resource that is bundled + * with the JAR. This preserves the historical behavior. If you want to + * use a different jetty.xml file, just override this property on the + * command line. + */ + String jettyXml = "bigdata-war/src/jetty.xml"; /* * Handle all arguments starting with "-". These should appear before @@ -214,6 +257,8 @@ } } else if (arg.equals("-servletContextListenerClass")) { servletContextListenerClass = args[++i]; + } else if (arg.equals("-jettyXml")) { + jettyXml = args[++i]; } else { usage(1/* status */, "Unknown argument: " + arg); } @@ -309,12 +354,26 @@ initParams.put(ConfigParams.SERVLET_CONTEXT_LISTENER_CLASS, servletContextListenerClass); - // Create the service. - final Server server = NanoSparqlServer.newInstance(port, propertyFile, - initParams); + final Server server; - // Start the service. - server.start(); + boolean ok = false; + try { + // Create the service. + server = NanoSparqlServer.newInstance(port, jettyXml, + null/* indexManager */, initParams); + // Start Server. + server.start(); + // Await running. + while (server.isStarting() && !server.isRunning()) { + Thread.sleep(100/* ms */); + } + ok = true; + } finally { + if (!ok) { + // Complain if Server did not start. + System.err.println("Server did not start."); + } + } /* * Report *an* effective URL of this service. @@ -327,7 +386,7 @@ final String serviceURL; { - final int actualPort = server.getConnectors()[0].getLocalPort(); + final int actualPort = getLocalPort(server); String hostAddr = NicUtil.getIpAddress("default.nic", "default", true/* loopbackOk */); @@ -351,118 +410,196 @@ } /** - * Variant used when you already have the {@link IIndexManager} on hand and - * DO NOT want to use <code>web.xml</code> and <code>jetty.xml</code>. For - * this case, the caller must specify the port and a default connection will - * be established at that port. This form is used by code that wants to - * embed a simple NSS end point. + * Start the embedded {@link Server}. + * <p> + * Note: The port override argument given here is applied by setting the + * {@link NanoSparqlServer.SystemProperties#JETTY_PORT} System property. The + * old value of that property is restored afterwards, but there is a + * side-effect which could be visible to concurrent threads. * * @param port * The port on which the service will run -OR- ZERO (0) for any * open port. * @param indexManager - * The {@link IIndexManager}. + * The {@link IIndexManager} (optional). * @param initParams * Initialization parameters for the web application as specified - * by {@link ConfigParams}. + * by {@link ConfigParams} (optional). * * @return The server instance. * - * @see <a href="http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty"> - * Embedding Jetty </a> + * @see SystemProperties */ static public Server newInstance(final int port, final IIndexManager indexManager, final Map<String, String> initParams) throws Exception { - - final Server server = new Server(port); - - final ServletContextHandler context = getContextHandler(initParams); - - final ResourceHandler resourceHandler = new ResourceHandler(); - setupStaticResources(NanoSparqlServer.class.getClassLoader(), - resourceHandler); - - // same resource base. - context.setResourceBase(resourceHandler.getResourceBase()); - context.setWelcomeFiles(resourceHandler.getWelcomeFiles()); + // The jetty.xml resource to be used. + final String jettyXml = System.getProperty(SystemProperties.JETTY_XML, + SystemProperties.DEFAULT_JETTY_XML); - final HandlerList handlers = new HandlerList(); - - handlers.setHandlers(new Handler[] { - context,// maps servlets - resourceHandler,// maps welcome files. - new DefaultHandler() // responsible for anything not explicitly served. - }); - - server.setHandler(handlers); + return newInstance(port, jettyXml, indexManager, initParams); - // Force the use of the caller's IIndexManager. - context.setAttribute(IIndexManager.class.getName(), indexManager); - - return server; - } - + /** - * Variant used when the life cycle of the {@link IIndexManager} will be - * managed by the server - this form is used by {@link #main(String[])}. + * Start the embedded {@link Server}. * <p> - * Note: This is mostly a convenience for scripts that do not need to take - * over the detailed control of the jetty container and the bigdata webapp. + * Note: The port override argument given here is applied by setting the + * {@link NanoSparqlServer.SystemProperties#JETTY_PORT} System property. The + * old value of that property is restored afterwards, but there is a + * side-effect which could be visible to concurrent threads. * * @param port * The port on which the service will run -OR- ZERO (0) for any * open port. - * @param propertyFile - * The <code>.properties</code> file (for a standalone database - * instance) or the <code>.config</code> file (for a federation). + * @param jettyXml + * The location of the <code>jetty.xml</code> resource. + * @param indexManager + * The {@link IIndexManager} (optional). * @param initParams * Initialization parameters for the web application as specified - * by {@link ConfigParams}. + * by {@link ConfigParams} (optional). * * @return The server instance. + * + * @see SystemProperties */ - static public Server newInstance... [truncated message content] |
From: <mrp...@us...> - 2014-03-13 13:55:50
|
Revision: 7953 http://sourceforge.net/p/bigdata/code/7953 Author: mrpersonick Date: 2014-03-13 13:55:47 +0000 (Thu, 13 Mar 2014) Log Message: ----------- fixing some CI errors Modified Paths: -------------- branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/rio/TestNTriplesWithSids.java Modified: branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/rio/TestNTriplesWithSids.java =================================================================== --- branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/rio/TestNTriplesWithSids.java 2014-03-13 13:53:26 UTC (rev 7952) +++ branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/rio/TestNTriplesWithSids.java 2014-03-13 13:55:47 UTC (rev 7953) @@ -110,6 +110,10 @@ log.info(store.dumpStore()); assertEquals("toldTriples", 3L, store.getStatementCount());//loadStats.toldTriples.get()); + + final BigdataStatementIterator it = store.getStatements(null, null, null); + while (it.hasNext()) + System.err.println(it.next()); final BigdataURI dcSource = store.getValueFactory().createURI( "http://purl.org/dc/terms/source"); @@ -256,8 +260,8 @@ if (log.isInfoEnabled()) log.info(store.dumpStore()); - assertEquals("toldTriples", 3L, loadStats.toldTriples.get()); - + assertEquals("toldTriples", 3L, store.getStatementCount());//loadStats.toldTriples.get()); + final BigdataURI dcSource = store.getValueFactory().createURI( "http://purl.org/dc/terms/source"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-13 13:53:30
|
Revision: 7952 http://sourceforge.net/p/bigdata/code/7952 Author: mrpersonick Date: 2014-03-13 13:53:26 +0000 (Thu, 13 Mar 2014) Log Message: ----------- fixing some CI errors Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataStatementIteratorImpl.java branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/TestAll.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/TestChangeSets.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/TestProvenanceQuery.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataStatementIteratorImpl.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataStatementIteratorImpl.java 2014-03-13 13:17:55 UTC (rev 7951) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataStatementIteratorImpl.java 2014-03-13 13:53:26 UTC (rev 7952) @@ -10,6 +10,7 @@ import org.openrdf.model.Value; import com.bigdata.rdf.internal.IV; +import com.bigdata.rdf.internal.impl.bnode.SidIV; import com.bigdata.rdf.model.BigdataBNode; import com.bigdata.rdf.model.BigdataBNodeImpl; import com.bigdata.rdf.model.BigdataResource; @@ -120,30 +121,39 @@ final IV<?,?> s = spo.s(); - if (bnodes == null || !bnodes.containsKey(s)) - ivs.add(s); +// if (bnodes == null || !bnodes.containsKey(s)) +// ivs.add(s); + + handleIV(s, ivs); } - ivs.add(spo.p()); +// ivs.add(spo.p()); + handleIV(spo.p(), ivs); + { final IV<?,?> o = spo.o(); - if (bnodes == null || !bnodes.containsKey(o)) - ivs.add(o); +// if (bnodes == null || !bnodes.containsKey(o)) +// ivs.add(o); + handleIV(o, ivs); + } { final IV<?,?> c = spo.c(); - if (c != null - && (bnodes == null || !bnodes.containsKey(c))) - ivs.add(c); +// if (c != null +// && (bnodes == null || !bnodes.containsKey(c))) +// ivs.add(c); + if (c != null) + handleIV(c, ivs); + } } @@ -226,6 +236,53 @@ } /** + * Add the IV to the list of terms to materialize, and also + * delegate to {@link #handleSid(SidIV, Collection, boolean)} if it's a + * SidIV. + */ + private void handleIV(final IV<?, ?> iv, + final Collection<IV<?, ?>> ids) { + + if (iv instanceof SidIV) { + + handleSid((SidIV<?>) iv, ids); + + } + + if (bnodes == null || !bnodes.containsKey(iv)) { + + ids.add(iv); + + } + + } + + /** + * Sids need to be handled specially because their individual ISPO + * components might need materialization as well. + */ + private void handleSid(final SidIV<?> sid, + final Collection<IV<?, ?>> ids) { + + final ISPO spo = sid.getInlineValue(); + + handleIV(spo.s(), ids); + + handleIV(spo.p(), ids); + + handleIV(spo.o(), ids); + + if (spo.c() != null) { + + handleIV(spo.c(), ids); + + } + + } + + + + /** * Resolve a term identifier to the {@link BigdataValue}, checking the * {@link #bnodes} map if it is defined. * Modified: branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/TestAll.java =================================================================== --- branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/TestAll.java 2014-03-13 13:17:55 UTC (rev 7951) +++ branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/rio/rdfxml/TestAll.java 2014-03-13 13:53:26 UTC (rev 7952) @@ -60,18 +60,18 @@ final TestSuite suite = new TestSuite("Bigdata RDF/XML extension"); - suite.addTestSuite(TestRDFXMLParserFactory.class); +// suite.addTestSuite(TestRDFXMLParserFactory.class); +// +// suite.addTestSuite(TestRDFXMLWriterFactory.class); +// +// try { +// suite.addTest(RDFXMLParserTest.suite()); +// } catch (Exception ex) { +// log.error(ex, ex); +// } +// +// suite.addTestSuite(RDFXMLWriterTest.class); - suite.addTestSuite(TestRDFXMLWriterFactory.class); - - try { - suite.addTest(RDFXMLParserTest.suite()); - } catch (Exception ex) { - log.error(ex, ex); - } - - suite.addTestSuite(RDFXMLWriterTest.class); - return suite; } Modified: branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/TestChangeSets.java =================================================================== --- branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/TestChangeSets.java 2014-03-13 13:17:55 UTC (rev 7951) +++ branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/TestChangeSets.java 2014-03-13 13:53:26 UTC (rev 7952) @@ -45,6 +45,7 @@ import com.bigdata.rdf.changesets.IChangeRecord; import com.bigdata.rdf.changesets.InMemChangeLog; import com.bigdata.rdf.changesets.InferenceChangeLogReporter; +import com.bigdata.rdf.model.BigdataBNode; import com.bigdata.rdf.model.BigdataStatement; import com.bigdata.rdf.model.BigdataValueFactory; import com.bigdata.rdf.spo.ModifiedEnum; @@ -445,17 +446,20 @@ final URI x = vf.createURI(ns+"X"); final URI y = vf.createURI(ns+"Y"); final URI z = vf.createURI(ns+"Z"); - final BNode sid1 = vf.createBNode(); +// final BNode sid1 = vf.createBNode(); // final BNode sid2 = vf.createBNode(); + final BigdataStatement axb = vf.createStatement(a, x, b); + final BigdataBNode sid1 = vf.createBNode(axb); + final BigdataStatement[] add = new BigdataStatement[] { - vf.createStatement(a, x, b, sid1), + axb, vf.createStatement(sid1, y, c), vf.createStatement(d, z, sid1), }; final BigdataStatement[] explicitRemove = new BigdataStatement[] { - vf.createStatement(a, x, b, sid1), + axb, }; final BigdataStatement[] inferredRemove = new BigdataStatement[] { Modified: branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/TestProvenanceQuery.java =================================================================== --- branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/TestProvenanceQuery.java 2014-03-13 13:17:55 UTC (rev 7951) +++ branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/TestProvenanceQuery.java 2014-03-13 13:53:26 UTC (rev 7952) @@ -125,10 +125,6 @@ assertNotNull(writerFactory); - if (!(writerFactory instanceof BigdataRDFXMLWriterFactory)) - fail("Expecting " + BigdataRDFXMLWriterFactory.class + " not " - + writerFactory.getClass()); - final RDFWriter rdfWriter = writerFactory.getWriter(w); rdfWriter.startRDF(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-13 13:17:58
|
Revision: 7951 http://sourceforge.net/p/bigdata/code/7951 Author: thompsonbry Date: 2014-03-13 13:17:55 +0000 (Thu, 13 Mar 2014) Log Message: ----------- @Override flag. Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/AbstractIV.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/AbstractIV.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/AbstractIV.java 2014-03-13 02:39:08 UTC (rev 7950) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/AbstractIV.java 2014-03-13 13:17:55 UTC (rev 7951) @@ -315,6 +315,7 @@ } + @Override final public byte flags() { return flags; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-13 02:39:13
|
Revision: 7950 http://sourceforge.net/p/bigdata/code/7950 Author: mrpersonick Date: 2014-03-13 02:39:08 +0000 (Thu, 13 Mar 2014) Log Message: ----------- cleanup Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java 2014-03-13 00:16:49 UTC (rev 7949) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java 2014-03-13 02:39:08 UTC (rev 7950) @@ -156,20 +156,6 @@ return TupleQueryResultFormat.JSON; } - public void startRDF() { - - try { - - startQueryResult(Arrays.asList(new String[] { - "s", "p", "o", "c" - })); - - } catch (TupleQueryResultHandlerException e) { - throw new RuntimeException(e); - } - - } - public void startQueryResult(List<String> columnHeaders) throws TupleQueryResultHandlerException { @@ -198,18 +184,6 @@ } } - public void endRDF() { - - try { - - endQueryResult(); - - } catch (TupleQueryResultHandlerException e) { - throw new RuntimeException(e); - } - - } - public void endQueryResult() throws TupleQueryResultHandlerException { @@ -224,7 +198,7 @@ } } - public void handleStatement(final Statement stmt) + public void handleStatement(final Statement stmt) throws RDFHandlerException { try { if (firstTupleWritten) { @@ -262,10 +236,10 @@ writer.flush(); } catch (TupleQueryResultHandlerException e) { - throw new RuntimeException(e); + throw new RDFHandlerException(e); } catch (IOException e) { - throw new RuntimeException(e); + throw new RDFHandlerException(e); } } @@ -447,7 +421,39 @@ writer.writeEOL(); } + /*-------------------* + * RDFWriter Methods * + *-------------------*/ + @Override + public void startRDF() throws RDFHandlerException { + + try { + + startQueryResult(Arrays.asList(new String[] { + "s", "p", "o", "c" + })); + + } catch (TupleQueryResultHandlerException e) { + throw new RDFHandlerException(e); + } + + } + + @Override + public void endRDF() throws RDFHandlerException { + + try { + + endQueryResult(); + + } catch (TupleQueryResultHandlerException e) { + throw new RDFHandlerException(e); + } + + } + + @Override public void handleComment(String arg0) throws RDFHandlerException { // TODO Implement me @@ -463,7 +469,7 @@ @Override public RDFFormat getRDFFormat() { - return null; + return BigdataSPARQLResultsJSONWriterFactoryForConstruct.JSON; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-13 00:16:52
|
Revision: 7949 http://sourceforge.net/p/bigdata/code/7949 Author: mrpersonick Date: 2014-03-13 00:16:49 +0000 (Thu, 13 Mar 2014) Log Message: ----------- Supporting tickets 848 and 849. Added RDR-enabled JSON support for select and construct. Added RDR-enabled TurtleWriter for export. Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFWriterFactory Added Paths: ----------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForConstruct.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForSelect.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriter.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriterFactory.java Removed Paths: ------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java 2014-03-13 00:11:05 UTC (rev 7948) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java 2014-03-13 00:16:49 UTC (rev 7949) @@ -32,15 +32,18 @@ import java.util.ServiceLoader; import org.openrdf.query.QueryLanguage; -import org.openrdf.query.resultio.TupleQueryResultParserRegistry; import org.openrdf.query.resultio.TupleQueryResultWriterRegistry; import org.openrdf.rio.RDFFormat; import org.openrdf.rio.RDFParserRegistry; +import org.openrdf.rio.RDFWriterRegistry; import com.bigdata.rdf.model.StatementEnum; -import com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactory; +import com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactoryForConstruct; +import com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactoryForSelect; import com.bigdata.rdf.rio.ntriples.BigdataNTriplesParserFactory; +import com.bigdata.rdf.rio.rdfxml.BigdataRDFXMLWriterFactory; import com.bigdata.rdf.rio.turtle.BigdataTurtleParserFactory; +import com.bigdata.rdf.rio.turtle.BigdataTurtleWriterFactory; /** * This static class provides a hook which allows the replacement of services @@ -125,19 +128,23 @@ final TupleQueryResultWriterRegistry r = TupleQueryResultWriterRegistry.getInstance(); // add our custom RDR-enabled JSON writer - r.add(new BigdataSPARQLResultsJSONWriterFactory()); + r.add(new BigdataSPARQLResultsJSONWriterFactoryForSelect()); } -// // Ditto, but for the writer. -// { -// final RDFWriterRegistry r = RDFWriterRegistry.getInstance(); -// + // Ditto, but for the writer. + { + final RDFWriterRegistry r = RDFWriterRegistry.getInstance(); + // r.add(new BigdataRDFXMLWriterFactory()); -// -// } + + r.add(new BigdataTurtleWriterFactory()); + r.add(new BigdataSPARQLResultsJSONWriterFactoryForConstruct()); + + } + // { // final PropertiesParserRegistry r = PropertiesParserRegistry.getInstance(); // Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java 2014-03-13 00:11:05 UTC (rev 7948) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java 2014-03-13 00:16:49 UTC (rev 7949) @@ -14,11 +14,13 @@ import java.io.OutputStreamWriter; import java.io.Writer; import java.nio.charset.Charset; +import java.util.Arrays; import java.util.Iterator; import java.util.List; import org.openrdf.model.BNode; import org.openrdf.model.Literal; +import org.openrdf.model.Statement; import org.openrdf.model.URI; import org.openrdf.model.Value; import org.openrdf.query.Binding; @@ -26,6 +28,9 @@ import org.openrdf.query.TupleQueryResultHandlerException; import org.openrdf.query.resultio.TupleQueryResultFormat; import org.openrdf.query.resultio.TupleQueryResultWriter; +import org.openrdf.rio.RDFFormat; +import org.openrdf.rio.RDFHandlerException; +import org.openrdf.rio.RDFWriter; import com.bigdata.rdf.model.BigdataBNode; import com.bigdata.rdf.model.BigdataStatement; @@ -35,7 +40,7 @@ * href="http://www.w3.org/TR/rdf-sparql-json-res/">SPARQL Query Results JSON * Format</a>. */ -public class BigdataSPARQLResultsJSONWriter implements TupleQueryResultWriter { +public class BigdataSPARQLResultsJSONWriter implements TupleQueryResultWriter, RDFWriter { /*-----------* * Variables * @@ -50,7 +55,10 @@ *--------------*/ public BigdataSPARQLResultsJSONWriter(OutputStream out) { - Writer w = new OutputStreamWriter(out, Charset.forName("UTF-8")); + this(new OutputStreamWriter(out, Charset.forName("UTF-8"))); + } + + public BigdataSPARQLResultsJSONWriter(Writer w) { w = new BufferedWriter(w, 1024); writer = new IndentingWriter(w); } @@ -148,6 +156,20 @@ return TupleQueryResultFormat.JSON; } + public void startRDF() { + + try { + + startQueryResult(Arrays.asList(new String[] { + "s", "p", "o", "c" + })); + + } catch (TupleQueryResultHandlerException e) { + throw new RuntimeException(e); + } + + } + public void startQueryResult(List<String> columnHeaders) throws TupleQueryResultHandlerException { @@ -176,6 +198,18 @@ } } + public void endRDF() { + + try { + + endQueryResult(); + + } catch (TupleQueryResultHandlerException e) { + throw new RuntimeException(e); + } + + } + public void endQueryResult() throws TupleQueryResultHandlerException { @@ -190,6 +224,51 @@ } } + public void handleStatement(final Statement stmt) + { + try { + if (firstTupleWritten) { + writeComma(); + } + else { + firstTupleWritten = true; + } + + openBraces(); // start of new solution + + writeKeyValue("s", stmt.getSubject()); + writeComma(); + writeKeyValue("p", stmt.getPredicate()); + writeComma(); + writeKeyValue("o", stmt.getObject()); + if (stmt.getContext() != null) { + writeComma(); + writeKeyValue("c", stmt.getContext()); + } + +// Iterator<Binding> bindingIter = bindingSet.iterator(); +// while (bindingIter.hasNext()) { +// Binding binding = bindingIter.next(); +// +// writeKeyValue(binding.getName(), binding.getValue()); +// +// if (bindingIter.hasNext()) { +// writeComma(); +// } +// } + + closeBraces(); // end solution + + writer.flush(); + } + catch (TupleQueryResultHandlerException e) { + throw new RuntimeException(e); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + public void handleSolution(BindingSet bindingSet) throws TupleQueryResultHandlerException { @@ -367,4 +446,24 @@ writer.write(", "); writer.writeEOL(); } + + @Override + public void handleComment(String arg0) throws RDFHandlerException { + // TODO Implement me + + } + + @Override + public void handleNamespace(String arg0, String arg1) + throws RDFHandlerException { + // TODO Implement me + + } + + @Override + public RDFFormat getRDFFormat() { + + return null; + + } } Deleted: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java 2014-03-13 00:11:05 UTC (rev 7948) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java 2014-03-13 00:16:49 UTC (rev 7949) @@ -1,35 +0,0 @@ -/* - * Copyright Aduna (http://www.aduna-software.com/) (c) 2007. - * - * Licensed under the Aduna BSD-style license. - */ -package com.bigdata.rdf.rio.json; - -import java.io.OutputStream; - -import org.openrdf.query.resultio.TupleQueryResultFormat; -import org.openrdf.query.resultio.TupleQueryResultWriter; -import org.openrdf.query.resultio.TupleQueryResultWriterFactory; - -/** - * A {@link TupleQueryResultWriterFactory} for writers of SPARQL/JSON query - * results. - * - * @author Arjohn Kampman - */ -public class BigdataSPARQLResultsJSONWriterFactory implements TupleQueryResultWriterFactory { - - /** - * Returns {@link TupleQueryResultFormat#JSON}. - */ - public TupleQueryResultFormat getTupleQueryResultFormat() { - return TupleQueryResultFormat.JSON; - } - - /** - * Returns a new instance of SPARQLResultsJSONWriter. - */ - public TupleQueryResultWriter getWriter(OutputStream out) { - return new BigdataSPARQLResultsJSONWriter(out); - } -} Added: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForConstruct.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForConstruct.java (rev 0) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForConstruct.java 2014-03-13 00:16:49 UTC (rev 7949) @@ -0,0 +1,61 @@ +/* + * Copyright Aduna (http://www.aduna-software.com/) (c) 2007. + * + * Licensed under the Aduna BSD-style license. + */ +package com.bigdata.rdf.rio.json; + +import java.io.OutputStream; +import java.io.Writer; +import java.nio.charset.Charset; + +import org.openrdf.query.resultio.TupleQueryResultFormat; +import org.openrdf.query.resultio.TupleQueryResultWriterFactory; +import org.openrdf.rio.RDFFormat; +import org.openrdf.rio.RDFWriter; +import org.openrdf.rio.RDFWriterFactory; + +/** + * A {@link TupleQueryResultWriterFactory} for writers of SPARQL/JSON query + * results. + * + * @author Arjohn Kampman + */ +public class BigdataSPARQLResultsJSONWriterFactoryForConstruct implements RDFWriterFactory { + + public static final RDFFormat JSON = new RDFFormat( + "JSON", // name + "application/sparql-results+json", // mime-type + Charset.forName("UTF-8"), // charset + "json", // file extension + false, // supports namespaces + true // supports contexts + ); + + static { + + RDFFormat.register(JSON); + + } + + /** + * Returns {@link TupleQueryResultFormat#JSON}. + */ + public RDFFormat getRDFFormat() { + return JSON; + } + + /** + * Returns a new instance of SPARQLResultsJSONWriter. + */ + public RDFWriter getWriter(OutputStream out) { + return new BigdataSPARQLResultsJSONWriter(out); + } + + /** + * Returns a new instance of SPARQLResultsJSONWriter. + */ + public RDFWriter getWriter(Writer writer) { + return new BigdataSPARQLResultsJSONWriter(writer); + } +} Property changes on: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForConstruct.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Copied: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForSelect.java (from rev 7946, branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java) =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForSelect.java (rev 0) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForSelect.java 2014-03-13 00:16:49 UTC (rev 7949) @@ -0,0 +1,35 @@ +/* + * Copyright Aduna (http://www.aduna-software.com/) (c) 2007. + * + * Licensed under the Aduna BSD-style license. + */ +package com.bigdata.rdf.rio.json; + +import java.io.OutputStream; + +import org.openrdf.query.resultio.TupleQueryResultFormat; +import org.openrdf.query.resultio.TupleQueryResultWriter; +import org.openrdf.query.resultio.TupleQueryResultWriterFactory; + +/** + * A {@link TupleQueryResultWriterFactory} for writers of SPARQL/JSON query + * results. + * + * @author Arjohn Kampman + */ +public class BigdataSPARQLResultsJSONWriterFactoryForSelect implements TupleQueryResultWriterFactory { + + /** + * Returns {@link TupleQueryResultFormat#JSON}. + */ + public TupleQueryResultFormat getTupleQueryResultFormat() { + return TupleQueryResultFormat.JSON; + } + + /** + * Returns a new instance of SPARQLResultsJSONWriter. + */ + public TupleQueryResultWriter getWriter(OutputStream out) { + return new BigdataSPARQLResultsJSONWriter(out); + } +} Property changes on: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactoryForSelect.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriter.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriter.java (rev 0) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriter.java 2014-03-13 00:16:49 UTC (rev 7949) @@ -0,0 +1,410 @@ +/* + * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007. + * + * Licensed under the Aduna BSD-style license. + */ +package com.bigdata.rdf.rio.turtle; + +import info.aduna.io.IndentingWriter; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.Writer; +import java.util.Map; + +import org.openrdf.model.BNode; +import org.openrdf.model.Literal; +import org.openrdf.model.Resource; +import org.openrdf.model.URI; +import org.openrdf.rio.RDFWriter; +import org.openrdf.rio.turtle.TurtleUtil; +import org.openrdf.rio.turtle.TurtleWriter; + +import com.bigdata.rdf.model.BigdataBNode; +import com.bigdata.rdf.model.BigdataStatement; + +/** + * An implementation of the RDFWriter interface that writes RDF documents in + * Turtle format. The Turtle format is defined in <a + * href="http://www.dajobe.org/2004/01/turtle/">in this document</a>. + */ +public class BigdataTurtleWriter extends TurtleWriter implements RDFWriter { + + /*-----------* + * Variables * + *-----------*/ + +// protected IndentingWriter writer; +// +// /** +// * Table mapping namespace names (key) to namespace prefixes (value). +// */ +// protected Map<String, String> namespaceTable; +// +// protected boolean writingStarted; +// +// /** +// * Flag indicating whether the last written statement has been closed. +// */ +// protected boolean statementClosed; +// +// protected Resource lastWrittenSubject; +// +// protected URI lastWrittenPredicate; + + /*--------------* + * Constructors * + *--------------*/ + + /** + * Creates a new TurtleWriter that will write to the supplied OutputStream. + * + * @param out + * The OutputStream to write the Turtle document to. + */ + public BigdataTurtleWriter(OutputStream out) { + super(out); + } + + /** + * Creates a new TurtleWriter that will write to the supplied Writer. + * + * @param writer + * The Writer to write the Turtle document to. + */ + public BigdataTurtleWriter(Writer writer) { + super(writer); + } + + /*---------* + * Methods * + *---------*/ + +// public RDFFormat getRDFFormat() { +// return RDFFormat.TURTLE; +// } +// +// public void startRDF() +// throws RDFHandlerException +// { +// if (writingStarted) { +// throw new RuntimeException("Document writing has already started"); +// } +// +// writingStarted = true; +// +// try { +// // Write namespace declarations +// for (Map.Entry<String, String> entry : namespaceTable.entrySet()) { +// String name = entry.getKey(); +// String prefix = entry.getValue(); +// +// writeNamespace(prefix, name); +// } +// +// if (!namespaceTable.isEmpty()) { +// writer.writeEOL(); +// } +// } +// catch (IOException e) { +// throw new RDFHandlerException(e); +// } +// } +// +// public void endRDF() +// throws RDFHandlerException +// { +// if (!writingStarted) { +// throw new RuntimeException("Document writing has not yet started"); +// } +// +// try { +// closePreviousStatement(); +// writer.flush(); +// } +// catch (IOException e) { +// throw new RDFHandlerException(e); +// } +// finally { +// writingStarted = false; +// } +// } +// +// public void handleNamespace(String prefix, String name) +// throws RDFHandlerException +// { +// try { +// if (!namespaceTable.containsKey(name)) { +// // Namespace not yet mapped to a prefix, try to give it the +// // specified prefix +// +// boolean isLegalPrefix = prefix.length() == 0 || TurtleUtil.isLegalPrefix(prefix); +// +// if (!isLegalPrefix || namespaceTable.containsValue(prefix)) { +// // Specified prefix is not legal or the prefix is already in use, +// // generate a legal unique prefix +// +// if (prefix.length() == 0 || !isLegalPrefix) { +// prefix = "ns"; +// } +// +// int number = 1; +// +// while (namespaceTable.containsValue(prefix + number)) { +// number++; +// } +// +// prefix += number; +// } +// +// namespaceTable.put(name, prefix); +// +// if (writingStarted) { +// closePreviousStatement(); +// +// writeNamespace(prefix, name); +// } +// } +// } +// catch (IOException e) { +// throw new RDFHandlerException(e); +// } +// } +// +// public void handleStatement(Statement st) +// throws RDFHandlerException +// { +// if (!writingStarted) { +// throw new RuntimeException("Document writing has not yet been started"); +// } +// +// Resource subj = st.getSubject(); +// URI pred = st.getPredicate(); +// Value obj = st.getObject(); +// +// try { +// if (subj.equals(lastWrittenSubject)) { +// if (pred.equals(lastWrittenPredicate)) { +// // Identical subject and predicate +// writer.write(" , "); +// } +// else { +// // Identical subject, new predicate +// writer.write(" ;"); +// writer.writeEOL(); +// +// // Write new predicate +// writePredicate(pred); +// writer.write(" "); +// lastWrittenPredicate = pred; +// } +// } +// else { +// // New subject +// closePreviousStatement(); +// +// // Write new subject: +// writer.writeEOL(); +// writeResource(subj); +// writer.write(" "); +// lastWrittenSubject = subj; +// +// // Write new predicate +// writePredicate(pred); +// writer.write(" "); +// lastWrittenPredicate = pred; +// +// statementClosed = false; +// writer.increaseIndentation(); +// } +// +// writeValue(obj); +// +// // Don't close the line just yet. Maybe the next +// // statement has the same subject and/or predicate. +// } +// catch (IOException e) { +// throw new RDFHandlerException(e); +// } +// } +// +// public void handleComment(String comment) +// throws RDFHandlerException +// { +// try { +// closePreviousStatement(); +// +// if (comment.indexOf('\r') != -1 || comment.indexOf('\n') != -1) { +// // Comment is not allowed to contain newlines or line feeds. +// // Split comment in individual lines and write comment lines +// // for each of them. +// StringTokenizer st = new StringTokenizer(comment, "\r\n"); +// while (st.hasMoreTokens()) { +// writeCommentLine(st.nextToken()); +// } +// } +// else { +// writeCommentLine(comment); +// } +// } +// catch (IOException e) { +// throw new RDFHandlerException(e); +// } +// } +// +// protected void writeCommentLine(String line) +// throws IOException +// { +// writer.write("# "); +// writer.write(line); +// writer.writeEOL(); +// } +// +// protected void writeNamespace(String prefix, String name) +// throws IOException +// { +// writer.write("@prefix "); +// writer.write(prefix); +// writer.write(": <"); +// writer.write(TurtleUtil.encodeURIString(name)); +// writer.write("> ."); +// writer.writeEOL(); +// } +// +// protected void writePredicate(URI predicate) +// throws IOException +// { +// if (predicate.equals(RDF.TYPE)) { +// // Write short-cut for rdf:type +// writer.write("a"); +// } +// else { +// writeURI(predicate); +// } +// } +// +// protected void writeValue(Value val) +// throws IOException +// { +// if (val instanceof Resource) { +// writeResource((Resource)val); +// } +// else { +// writeLiteral((Literal)val); +// } +// } +// +// protected void writeResource(Resource res) +// throws IOException +// { +// if (res instanceof URI) { +// writeURI((URI)res); +// } +// else { +// writeBNode((BNode)res); +// } +// } +// +// protected void writeURI(URI uri) +// throws IOException +// { +// String uriString = uri.toString(); +// +// // Try to find a prefix for the URI's namespace +// String prefix = null; +// +// int splitIdx = TurtleUtil.findURISplitIndex(uriString); +// if (splitIdx > 0) { +// String namespace = uriString.substring(0, splitIdx); +// prefix = namespaceTable.get(namespace); +// } +// +// if (prefix != null) { +// // Namespace is mapped to a prefix; write abbreviated URI +// writer.write(prefix); +// writer.write(":"); +// writer.write(uriString.substring(splitIdx)); +// } +// else { +// // Write full URI +// writer.write("<"); +// writer.write(TurtleUtil.encodeURIString(uriString)); +// writer.write(">"); +// } +// } + + protected void writeBNode(BNode bNode) + throws IOException + { + if (bNode instanceof BigdataBNode && + ((BigdataBNode) bNode).isStatementIdentifier()) { + writeSid((BigdataBNode) bNode); + } else { + writer.write("_:"); + writer.write(bNode.getID()); + } + } + + protected void writeSid(final BigdataBNode sid) + throws IOException + { + final BigdataStatement stmt = sid.getStatement(); + writer.write("<< "); + writeValue(stmt.getSubject()); + writer.write(", "); + writeValue(stmt.getPredicate()); + writer.write(", "); + writeValue(stmt.getObject()); + if (stmt.getContext() != null) { + writer.write(", "); + writeValue(stmt.getContext()); + } + writer.write(" >>"); + } + +// protected void writeLiteral(Literal lit) +// throws IOException +// { +// String label = lit.getLabel(); +// +// if (label.indexOf('\n') > 0 || label.indexOf('\r') > 0 || label.indexOf('\t') > 0) { +// // Write label as long string +// writer.write("\"\"\""); +// writer.write(TurtleUtil.encodeLongString(label)); +// writer.write("\"\"\""); +// } +// else { +// // Write label as normal string +// writer.write("\""); +// writer.write(TurtleUtil.encodeString(label)); +// writer.write("\""); +// } +// +// if (lit.getDatatype() != null) { +// // Append the literal's datatype (possibly written as an abbreviated +// // URI) +// writer.write("^^"); +// writeURI(lit.getDatatype()); +// } +// else if (lit.getLanguage() != null) { +// // Append the literal's language +// writer.write("@"); +// writer.write(lit.getLanguage()); +// } +// } +// +// protected void closePreviousStatement() +// throws IOException +// { +// if (!statementClosed) { +// // The previous statement still needs to be closed: +// writer.write(" ."); +// writer.writeEOL(); +// writer.decreaseIndentation(); +// +// statementClosed = true; +// lastWrittenSubject = null; +// lastWrittenPredicate = null; +// } +// } +} Property changes on: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriter.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriterFactory.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriterFactory.java (rev 0) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriterFactory.java 2014-03-13 00:16:49 UTC (rev 7949) @@ -0,0 +1,42 @@ +/* + * Copyright Aduna (http://www.aduna-software.com/) (c) 2007. + * + * Licensed under the Aduna BSD-style license. + */ +package com.bigdata.rdf.rio.turtle; + +import java.io.OutputStream; +import java.io.Writer; + +import org.openrdf.rio.RDFFormat; +import org.openrdf.rio.RDFWriter; +import org.openrdf.rio.RDFWriterFactory; + +/** + * An {@link RDFWriterFactory} for Turtle writers. + * + * @author Arjohn Kampman + */ +public class BigdataTurtleWriterFactory implements RDFWriterFactory { + + /** + * Returns {@link RDFFormat#TURTLE}. + */ + public RDFFormat getRDFFormat() { + return RDFFormat.TURTLE; + } + + /** + * Returns a new instance of {@link BigdataTurtleWriter}. + */ + public RDFWriter getWriter(OutputStream out) { + return new BigdataTurtleWriter(out); + } + + /** + * Returns a new instance of {@link BigdataTurtleWriter}. + */ + public RDFWriter getWriter(Writer writer) { + return new BigdataTurtleWriter(writer); + } +} Property changes on: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleWriterFactory.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Modified: branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory =================================================================== --- branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory 2014-03-13 00:11:05 UTC (rev 7948) +++ branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory 2014-03-13 00:16:49 UTC (rev 7949) @@ -1 +1 @@ -com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactory +com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactoryForSelect Modified: branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFWriterFactory =================================================================== --- branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFWriterFactory 2014-03-13 00:11:05 UTC (rev 7948) +++ branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFWriterFactory 2014-03-13 00:16:49 UTC (rev 7949) @@ -0,0 +1,2 @@ +com.bigdata.rdf.rio.turtle.BigdataTurtleWriterFactory +com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactoryForConstruct \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-13 00:11:10
|
Revision: 7948 http://sourceforge.net/p/bigdata/code/7948 Author: mrpersonick Date: 2014-03-13 00:11:05 +0000 (Thu, 13 Mar 2014) Log Message: ----------- Changed the toString() on BigdataBNodes to report their sid (if it exists) instead of their node id. Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataBNodeImpl.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataBNodeImpl.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataBNodeImpl.java 2014-03-12 22:28:03 UTC (rev 7947) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataBNodeImpl.java 2014-03-13 00:11:05 UTC (rev 7948) @@ -156,6 +156,9 @@ public String toString() { + if (sid != null) { + return "<" + sid.toString() + ">"; + } return "_:" + id; } @@ -184,8 +187,7 @@ return false; if ((o instanceof BigdataValue) // - && isRealIV() - && ((BigdataValue)o).isRealIV() + && isRealIV() && ((BigdataValue)o).isRealIV() && ((BigdataValue) o).getValueFactory() == getValueFactory()) { return getIV().equals(((BigdataValue) o).getIV()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-12 22:28:08
|
Revision: 7947 http://sourceforge.net/p/bigdata/code/7947 Author: mrpersonick Date: 2014-03-12 22:28:03 +0000 (Wed, 12 Mar 2014) Log Message: ----------- minor change to the full text query Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 21:18:57 UTC (rev 7946) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 22:28:03 UTC (rev 7947) @@ -8,7 +8,7 @@ if(!term) { return; } - var query = 'select * { ?o bds:search "' + term + '" . ?s ?p ?o . }' + var query = 'select ?s ?p ?o { ?o bds:search "' + term + '" . ?s ?p ?o . }' $('#query-box').val(query); $('#query-form').submit(); showTab('query'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-12 21:19:05
|
Revision: 7946 http://sourceforge.net/p/bigdata/code/7946 Author: tobycraig Date: 2014-03-12 21:18:57 +0000 (Wed, 12 Mar 2014) Log Message: ----------- #845 - Fixed incorrect CSS id to hide namespace properties box before any properties are requested Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-03-12 21:08:16 UTC (rev 7945) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-03-12 21:18:57 UTC (rev 7946) @@ -181,6 +181,6 @@ font-family: monospace; } -#namespace-details { +#namespace-properties { display: none; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-12 21:08:23
|
Revision: 7945 http://sourceforge.net/p/bigdata/code/7945 Author: tobycraig Date: 2014-03-12 21:08:16 +0000 (Wed, 12 Mar 2014) Log Message: ----------- #850 - Search functionality Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js branches/RDR/bigdata-war/src/html/new.html Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 20:33:19 UTC (rev 7944) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 21:08:16 UTC (rev 7945) @@ -1,5 +1,19 @@ $(function() { +/* Search */ + +$('#search-form').submit(function(e) { + e.preventDefault(); + var term = $(this).find('input').val(); + if(!term) { + return; + } + var query = 'select * { ?o bds:search "' + term + '" . ?s ?p ?o . }' + $('#query-box').val(query); + $('#query-form').submit(); + showTab('query'); +}); + /* Tab selection */ $('#tab-selector a').click(function(e) { Modified: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html 2014-03-12 20:33:19 UTC (rev 7944) +++ branches/RDR/bigdata-war/src/html/new.html 2014-03-12 21:08:16 UTC (rev 7945) @@ -15,7 +15,7 @@ <div id="top"> <img src="/bigdata/html/images/logo.png" id="logo"> - <p><label for="search-text">Search:</label> <input type="text" id="search-text"></p> + <form id="search-form"><label for="search-text">Search:</label> <input type="text" id="search-text"></form> <p>Current namespace: <span id="current-namespace"></span></p> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-12 20:33:22
|
Revision: 7944 http://sourceforge.net/p/bigdata/code/7944 Author: tobycraig Date: 2014-03-12 20:33:19 +0000 (Wed, 12 Mar 2014) Log Message: ----------- #845 - Put namespace properties in a table Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js branches/RDR/bigdata-war/src/html/new.html Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 17:48:28 UTC (rev 7943) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 20:33:19 UTC (rev 7944) @@ -108,12 +108,12 @@ function getNamespaceProperties(namespace) { $('#namespace-properties h1').html(namespace); - $('#namespace-properties ul').empty(); + $('#namespace-properties table').empty(); $('#namespace-properties').show(); var url = '/bigdata/namespace/' + namespace + '/properties'; $.get(url, function(data) { $.each(data.getElementsByTagName('entry'), function(i, entry) { - $('#namespace-properties ul').append('<li>' + entry.getAttribute('key') + ': ' + entry.textContent + '</li>'); + $('#namespace-properties table').append('<tr><td>' + entry.getAttribute('key') + '</td><td>' + entry.textContent + '</td></tr>'); }); }); } Modified: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html 2014-03-12 17:48:28 UTC (rev 7943) +++ branches/RDR/bigdata-war/src/html/new.html 2014-03-12 20:33:19 UTC (rev 7944) @@ -170,7 +170,7 @@ <div id="namespace-properties" class="box"> <h1></h1> - <ul></ul> + <table></table> </div> <div class="box"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-12 17:48:31
|
Revision: 7943 http://sourceforge.net/p/bigdata/code/7943 Author: mrpersonick Date: 2014-03-12 17:48:28 +0000 (Wed, 12 Mar 2014) Log Message: ----------- Extended the SPARQL Results JSON writer to handle RDR. Tickets 849 and 848. Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFParserFactory branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFWriterFactory Added Paths: ----------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java 2014-03-12 17:47:35 UTC (rev 7942) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/ServiceProviderHook.java 2014-03-12 17:48:28 UTC (rev 7943) @@ -32,14 +32,14 @@ import java.util.ServiceLoader; import org.openrdf.query.QueryLanguage; +import org.openrdf.query.resultio.TupleQueryResultParserRegistry; +import org.openrdf.query.resultio.TupleQueryResultWriterRegistry; import org.openrdf.rio.RDFFormat; import org.openrdf.rio.RDFParserRegistry; -import org.openrdf.rio.RDFWriterRegistry; import com.bigdata.rdf.model.StatementEnum; +import com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactory; import com.bigdata.rdf.rio.ntriples.BigdataNTriplesParserFactory; -import com.bigdata.rdf.rio.rdfxml.BigdataRDFXMLParserFactory; -import com.bigdata.rdf.rio.rdfxml.BigdataRDFXMLWriterFactory; import com.bigdata.rdf.rio.turtle.BigdataTurtleParserFactory; /** @@ -119,7 +119,17 @@ r.add(new BigdataTurtleParserFactory()); } + + { + + final TupleQueryResultWriterRegistry r = TupleQueryResultWriterRegistry.getInstance(); + // add our custom RDR-enabled JSON writer + r.add(new BigdataSPARQLResultsJSONWriterFactory()); + + } + + // // Ditto, but for the writer. // { // final RDFWriterRegistry r = RDFWriterRegistry.getInstance(); Added: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java (rev 0) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java 2014-03-12 17:48:28 UTC (rev 7943) @@ -0,0 +1,370 @@ +/* + * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007. + * + * Licensed under the Aduna BSD-style license. + */ +package com.bigdata.rdf.rio.json; + +import info.aduna.io.IndentingWriter; +import info.aduna.text.StringUtil; + +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.nio.charset.Charset; +import java.util.Iterator; +import java.util.List; + +import org.openrdf.model.BNode; +import org.openrdf.model.Literal; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.query.Binding; +import org.openrdf.query.BindingSet; +import org.openrdf.query.TupleQueryResultHandlerException; +import org.openrdf.query.resultio.TupleQueryResultFormat; +import org.openrdf.query.resultio.TupleQueryResultWriter; + +import com.bigdata.rdf.model.BigdataBNode; +import com.bigdata.rdf.model.BigdataStatement; + +/** + * A TupleQueryResultWriter that writes query results in the <a + * href="http://www.w3.org/TR/rdf-sparql-json-res/">SPARQL Query Results JSON + * Format</a>. + */ +public class BigdataSPARQLResultsJSONWriter implements TupleQueryResultWriter { + + /*-----------* + * Variables * + *-----------*/ + + private IndentingWriter writer; + + private boolean firstTupleWritten; + + /*--------------* + * Constructors * + *--------------*/ + + public BigdataSPARQLResultsJSONWriter(OutputStream out) { + Writer w = new OutputStreamWriter(out, Charset.forName("UTF-8")); + w = new BufferedWriter(w, 1024); + writer = new IndentingWriter(w); + } + + /*---------* + * Methods * + *---------*/ + + /** + * This is the only method that is different from the OpenRDF version. + * I could not subclass their implementation because the IndentingWriter + * is private. + */ + private void writeValue(Value value) + throws IOException, TupleQueryResultHandlerException + { + writer.write("{ "); + + if (value instanceof URI) { + writeKeyValue("type", "uri"); + writer.write(", "); + writeKeyValue("value", ((URI)value).toString()); + } + else if (value instanceof BigdataBNode && + ((BigdataBNode) value).isStatementIdentifier()) { + +// "bindings": [ +// { +// "book": { "type": "uri" , "value": "http://example.org/book/book6" } , +// "title": { "type": "literal" , "value": "Harry Potter and the Half-Blood Prince" } +// } , +// { +// "book": { "type": "sid" , "value": +// { +// "s": { "type": "uri" , "value": "<s>" } , +// "p": { "type": "uri" , "value": "<p>" } , +// "o": { "type": "uri" , "value": "<o>" } +// } +// } +// "title": { "type": "literal" , "value": "Harry Potter and the Deathly Hallows" } +// } , + + final BigdataBNode bnode = (BigdataBNode) value; + final BigdataStatement stmt = bnode.getStatement(); + writeKeyValue("type", "sid"); + writer.write(", "); + writeKey("value"); + openBraces(); + writeKeyValue("sid-s", stmt.getSubject()); + writeComma(); + writeKeyValue("sid-p", stmt.getPredicate()); + writeComma(); + writeKeyValue("sid-o", stmt.getObject()); + + if (stmt.getContext() != null) { + writeComma(); + writeKeyValue("sid-c", stmt.getContext()); + } + closeBraces(); + + } + else if (value instanceof BNode) { + writeKeyValue("type", "bnode"); + writer.write(", "); + writeKeyValue("value", ((BNode)value).getID()); + } + else if (value instanceof Literal) { + Literal lit = (Literal)value; + + if (lit.getDatatype() != null) { + writeKeyValue("type", "typed-literal"); + writer.write(", "); + writeKeyValue("datatype", lit.getDatatype().toString()); + } + else { + writeKeyValue("type", "literal"); + if (lit.getLanguage() != null) { + writer.write(", "); + writeKeyValue("xml:lang", lit.getLanguage()); + } + } + + writer.write(", "); + writeKeyValue("value", lit.getLabel()); + } + else { + throw new TupleQueryResultHandlerException("Unknown Value object type: " + value.getClass()); + } + + writer.write(" }"); + } + + + public final TupleQueryResultFormat getTupleQueryResultFormat() { + return TupleQueryResultFormat.JSON; + } + + public void startQueryResult(List<String> columnHeaders) + throws TupleQueryResultHandlerException + { + try { + openBraces(); + + // Write header + writeKey("head"); + openBraces(); + writeKeyValue("vars", columnHeaders); + closeBraces(); + + writeComma(); + + // Write results + writeKey("results"); + openBraces(); + + writeKey("bindings"); + openArray(); + + firstTupleWritten = false; + } + catch (IOException e) { + throw new TupleQueryResultHandlerException(e); + } + } + + public void endQueryResult() + throws TupleQueryResultHandlerException + { + try { + closeArray(); // bindings array + closeBraces(); // results braces + closeBraces(); // root braces + writer.flush(); + } + catch (IOException e) { + throw new TupleQueryResultHandlerException(e); + } + } + + public void handleSolution(BindingSet bindingSet) + throws TupleQueryResultHandlerException + { + try { + if (firstTupleWritten) { + writeComma(); + } + else { + firstTupleWritten = true; + } + + openBraces(); // start of new solution + + Iterator<Binding> bindingIter = bindingSet.iterator(); + while (bindingIter.hasNext()) { + Binding binding = bindingIter.next(); + + writeKeyValue(binding.getName(), binding.getValue()); + + if (bindingIter.hasNext()) { + writeComma(); + } + } + + closeBraces(); // end solution + + writer.flush(); + } + catch (IOException e) { + throw new TupleQueryResultHandlerException(e); + } + } + + private void writeKeyValue(String key, String value) + throws IOException + { + writeKey(key); + writeString(value); + } + + private void writeKeyValue(String key, Value value) + throws IOException, TupleQueryResultHandlerException + { + writeKey(key); + writeValue(value); + } + + private void writeKeyValue(String key, Iterable<String> array) + throws IOException + { + writeKey(key); + writeArray(array); + } + + private void writeKey(String key) + throws IOException + { + writeString(key); + writer.write(": "); + } + +// private void writeValue(Value value) +// throws IOException, TupleQueryResultHandlerException +// { +// writer.write("{ "); +// +// if (value instanceof URI) { +// writeKeyValue("type", "uri"); +// writer.write(", "); +// writeKeyValue("value", ((URI)value).toString()); +// } +// else if (value instanceof BNode) { +// writeKeyValue("type", "bnode"); +// writer.write(", "); +// writeKeyValue("value", ((BNode)value).getID()); +// } +// else if (value instanceof Literal) { +// Literal lit = (Literal)value; +// +// if (lit.getDatatype() != null) { +// writeKeyValue("type", "typed-literal"); +// writer.write(", "); +// writeKeyValue("datatype", lit.getDatatype().toString()); +// } +// else { +// writeKeyValue("type", "literal"); +// if (lit.getLanguage() != null) { +// writer.write(", "); +// writeKeyValue("xml:lang", lit.getLanguage()); +// } +// } +// +// writer.write(", "); +// writeKeyValue("value", lit.getLabel()); +// } +// else { +// throw new TupleQueryResultHandlerException("Unknown Value object type: " + value.getClass()); +// } +// +// writer.write(" }"); +// } + + private void writeString(String value) + throws IOException + { + // Escape special characters + value = StringUtil.gsub("\\", "\\\\", value); + value = StringUtil.gsub("\"", "\\\"", value); + value = StringUtil.gsub("/", "\\/", value); + value = StringUtil.gsub("\b", "\\b", value); + value = StringUtil.gsub("\f", "\\f", value); + value = StringUtil.gsub("\n", "\\n", value); + value = StringUtil.gsub("\r", "\\r", value); + value = StringUtil.gsub("\t", "\\t", value); + + writer.write("\""); + writer.write(value); + writer.write("\""); + } + + private void writeArray(Iterable<String> array) + throws IOException + { + writer.write("[ "); + + Iterator<String> iter = array.iterator(); + while (iter.hasNext()) { + String value = iter.next(); + + writeString(value); + + if (iter.hasNext()) { + writer.write(", "); + } + } + + writer.write(" ]"); + } + + private void openArray() + throws IOException + { + writer.write("["); + writer.writeEOL(); + writer.increaseIndentation(); + } + + private void closeArray() + throws IOException + { + writer.writeEOL(); + writer.decreaseIndentation(); + writer.write("]"); + } + + private void openBraces() + throws IOException + { + writer.write("{"); + writer.writeEOL(); + writer.increaseIndentation(); + } + + private void closeBraces() + throws IOException + { + writer.writeEOL(); + writer.decreaseIndentation(); + writer.write("}"); + } + + private void writeComma() + throws IOException + { + writer.write(", "); + writer.writeEOL(); + } +} Property changes on: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriter.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java (rev 0) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java 2014-03-12 17:48:28 UTC (rev 7943) @@ -0,0 +1,35 @@ +/* + * Copyright Aduna (http://www.aduna-software.com/) (c) 2007. + * + * Licensed under the Aduna BSD-style license. + */ +package com.bigdata.rdf.rio.json; + +import java.io.OutputStream; + +import org.openrdf.query.resultio.TupleQueryResultFormat; +import org.openrdf.query.resultio.TupleQueryResultWriter; +import org.openrdf.query.resultio.TupleQueryResultWriterFactory; + +/** + * A {@link TupleQueryResultWriterFactory} for writers of SPARQL/JSON query + * results. + * + * @author Arjohn Kampman + */ +public class BigdataSPARQLResultsJSONWriterFactory implements TupleQueryResultWriterFactory { + + /** + * Returns {@link TupleQueryResultFormat#JSON}. + */ + public TupleQueryResultFormat getTupleQueryResultFormat() { + return TupleQueryResultFormat.JSON; + } + + /** + * Returns a new instance of SPARQLResultsJSONWriter. + */ + public TupleQueryResultWriter getWriter(OutputStream out) { + return new BigdataSPARQLResultsJSONWriter(out); + } +} Property changes on: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/json/BigdataSPARQLResultsJSONWriterFactory.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory =================================================================== --- branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory (rev 0) +++ branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory 2014-03-12 17:48:28 UTC (rev 7943) @@ -0,0 +1 @@ +com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONWriterFactory Modified: branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFParserFactory =================================================================== --- branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFParserFactory 2014-03-12 17:47:35 UTC (rev 7942) +++ branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFParserFactory 2014-03-12 17:48:28 UTC (rev 7943) @@ -1,2 +1,3 @@ -com.bigdata.rdf.rio.nquads.NQuadsParserFactory -com.bigdata.rdf.rio.rdfxml.BigdataRDFXMLParserFactory +com.bigdata.rdf.rio.nquads.NQuadsParserFactory +com.bigdata.rdf.rio.ntriples.BigdataNTriplesParserFactory +com.bigdata.rdf.rio.turtle.BigdataTurtleParserFactory Modified: branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFWriterFactory =================================================================== --- branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFWriterFactory 2014-03-12 17:47:35 UTC (rev 7942) +++ branches/RDR/bigdata-rdf/src/resources/service-providers/META-INF/services/org.openrdf.rio.RDFWriterFactory 2014-03-12 17:48:28 UTC (rev 7943) @@ -1 +0,0 @@ -com.bigdata.rdf.rio.rdfxml.BigdataRDFXMLWriterFactory This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-12 17:47:39
|
Revision: 7942 http://sourceforge.net/p/bigdata/code/7942 Author: mrpersonick Date: 2014-03-12 17:47:35 +0000 (Wed, 12 Mar 2014) Log Message: ----------- Added support for resolving the RDR statement attached to a BigdataBNode representing a statement identifier. This is a precursor to being able to write RDF and SPARQL results in the RDR syntax. Ticket 849 Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/bop/rdf/join/ChunkedMaterializationOp.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/AbstractNonInlineIV.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/bnode/SidIV.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataBindingSetResolverator.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/bop/rdf/join/ChunkedMaterializationOp.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/bop/rdf/join/ChunkedMaterializationOp.java 2014-03-12 14:28:25 UTC (rev 7941) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/bop/rdf/join/ChunkedMaterializationOp.java 2014-03-12 17:47:35 UTC (rev 7942) @@ -48,8 +48,10 @@ import com.bigdata.bop.engine.BOpStats; import com.bigdata.rdf.internal.IV; import com.bigdata.rdf.internal.IVCache; +import com.bigdata.rdf.internal.impl.bnode.SidIV; import com.bigdata.rdf.lexicon.LexiconRelation; import com.bigdata.rdf.model.BigdataValue; +import com.bigdata.rdf.spo.ISPO; import com.bigdata.rdf.store.BigdataBindingSetResolverator; import com.bigdata.relation.accesspath.IBlockingBuffer; @@ -337,6 +339,8 @@ } +// handleIV(iv, ids, materializeInlineIVs); + } } else { @@ -365,6 +369,8 @@ } +// handleIV(iv, ids, materializeInlineIVs); + } } @@ -391,7 +397,57 @@ } } + + /** + * Either add the IV to the list if it needs materialization, or else + * delegate to {@link #handleSid(SidIV, Collection, boolean)} if it's a + * SidIV. + */ + static private void handleIV(final IV<?, ?> iv, + final Collection<IV<?, ?>> ids, + final boolean materializeInlineIVs) { + + if (iv instanceof SidIV) { + + handleSid((SidIV<?>) iv, ids, materializeInlineIVs); + + } else if (iv.needsMaterialization() || materializeInlineIVs) { + + ids.add(iv); + + } + + } + + /** + * Sids need to be handled specially because their individual ISPO + * components might need materialization. + */ + static private void handleSid(final SidIV<?> sid, + final Collection<IV<?, ?>> ids, + final boolean materializeInlineIVs) { + + final ISPO spo = sid.getInlineValue(); + + System.err.println("handling a sid"); + System.err.println("adding s: " + spo.s()); + System.err.println("adding p: " + spo.p()); + System.err.println("adding o: " + spo.o()); + + handleIV(spo.s(), ids, materializeInlineIVs); + + handleIV(spo.p(), ids, materializeInlineIVs); + + handleIV(spo.o(), ids, materializeInlineIVs); + + if (spo.c() != null) { + + handleIV(spo.c(), ids, materializeInlineIVs); + + } + } + /** * Resolve the term identifiers in the {@link IBindingSet} using the map * populated when we fetched the current chunk. Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/AbstractNonInlineIV.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/AbstractNonInlineIV.java 2014-03-12 14:28:25 UTC (rev 7941) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/AbstractNonInlineIV.java 2014-03-12 17:47:35 UTC (rev 7942) @@ -87,7 +87,8 @@ */ final public V asValue(final LexiconRelation lex) { - throw new UnsupportedOperationException(); + return getValue(); +// throw new UnsupportedOperationException(); } Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/bnode/SidIV.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/bnode/SidIV.java 2014-03-12 14:28:25 UTC (rev 7941) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/impl/bnode/SidIV.java 2014-03-12 17:47:35 UTC (rev 7942) @@ -46,6 +46,9 @@ import com.bigdata.rdf.internal.impl.AbstractInlineIV; import com.bigdata.rdf.lexicon.LexiconRelation; import com.bigdata.rdf.model.BigdataBNode; +import com.bigdata.rdf.model.BigdataResource; +import com.bigdata.rdf.model.BigdataURI; +import com.bigdata.rdf.model.BigdataValue; import com.bigdata.rdf.model.BigdataValueFactory; import com.bigdata.rdf.model.StatementEnum; import com.bigdata.rdf.spo.ISPO; @@ -169,6 +172,15 @@ bnode = (V) lex.getValueFactory().createBNode(getID()); bnode.setIV(this); bnode.setStatementIdentifier(true); + + final BigdataResource c = spo.c() != null ? + (BigdataResource) spo.c().asValue(lex) : null; + + bnode.setStatement(lex.getValueFactory().createStatement( + (BigdataResource) spo.s().asValue(lex), + (BigdataURI) spo.p().asValue(lex), + (BigdataValue) spo.o().asValue(lex), + c)); } return bnode; } Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java 2014-03-12 14:28:25 UTC (rev 7941) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java 2014-03-12 17:47:35 UTC (rev 7942) @@ -93,6 +93,7 @@ import com.bigdata.rdf.internal.VTE; import com.bigdata.rdf.internal.impl.BlobIV; import com.bigdata.rdf.internal.impl.TermId; +import com.bigdata.rdf.internal.impl.bnode.SidIV; import com.bigdata.rdf.internal.impl.extensions.XSDStringExtension; import com.bigdata.rdf.model.BigdataBNode; import com.bigdata.rdf.model.BigdataLiteral; @@ -2491,6 +2492,11 @@ // already materialized ret.put(iv, iv.getValue()); + } else if (iv instanceof SidIV) { + + // defer until the end + continue; + } else if (iv.isInline()) { // translate it into a value directly @@ -2532,61 +2538,83 @@ } - if (numNotFound == 0) { +// if (numNotFound == 0) { +// +// // Done. +// return ret; +// +// } - // Done. - return ret; + if (numNotFound > 0) { + // go to the indices + + /* + * Setup and run task(s) to resolve IV(s). + */ + + final ExecutorService service = getExecutorService(); + + final List<Callable<Void>> tasks = new LinkedList<Callable<Void>>(); + + if (!termIVs.isEmpty()) { + + tasks.add(new BatchResolveTermIVsTask(service, getId2TermIndex(), + termIVs, ret, termCache, valueFactory, termsChunksSize)); + + } + + if (!blobIVs.isEmpty()) { + + tasks.add(new BatchResolveBlobIVsTask(service, getBlobsIndex(), + blobIVs, ret, termCache, valueFactory, blobsChunkSize)); + + } + + if (log.isInfoEnabled()) + log.info("nterms=" + n + ", numNotFound=" + numNotFound + + ", cacheSize=" + termCache.size()); + + try { + + if (tasks.size() == 1) { + + tasks.get(0).call(); + + } else { + + // Co-thread tasks. + final List<Future<Void>> futures = getExecutorService() + .invokeAll(tasks); + + // Verify no errors. + for (Future<Void> f : futures) + f.get(); + + } + + } catch (Exception ex) { + + throw new RuntimeException(ex); + + } + } - + /* - * Setup and run task(s) to resolve IV(s). + * Defer SidIVs until the end so that their ISPO components can be + * materialized first. */ + for (IV<?,?> iv : ivs) { + + if (iv instanceof SidIV) { - final ExecutorService service = getExecutorService(); - - final List<Callable<Void>> tasks = new LinkedList<Callable<Void>>(); - - if (!termIVs.isEmpty()) { - - tasks.add(new BatchResolveTermIVsTask(service, getId2TermIndex(), - termIVs, ret, termCache, valueFactory, termsChunksSize)); - - } - - if (!blobIVs.isEmpty()) { - - tasks.add(new BatchResolveBlobIVsTask(service, getBlobsIndex(), - blobIVs, ret, termCache, valueFactory, blobsChunkSize)); - - } - - if (log.isInfoEnabled()) - log.info("nterms=" + n + ", numNotFound=" + numNotFound - + ", cacheSize=" + termCache.size()); - - try { - - if (tasks.size() == 1) { - - tasks.get(0).call(); - - } else { - - // Co-thread tasks. - final List<Future<Void>> futures = getExecutorService() - .invokeAll(tasks); - - // Verify no errors. - for (Future<Void> f : futures) - f.get(); + cacheTerms((SidIV<?>) iv, ret); + + // translate it into a value directly + ret.put(iv, iv.asValue(this)); + } - } - - } catch (Exception ex) { - - throw new RuntimeException(ex); - } final long elapsed = System.currentTimeMillis() - begin; @@ -2601,6 +2629,52 @@ } /** + * We need to cache the BigdataValues on the IV components within the + * SidIV so that the SidIV can materialize itself into a BigdataBNode + * properly. + */ + @SuppressWarnings("rawtypes") + final private void cacheTerms(final SidIV sid, + final Map<IV<?, ?>, BigdataValue> terms) { + + final ISPO spo = sid.getInlineValue(); + + cacheTerm(spo.s(), terms); + + cacheTerm(spo.p(), terms); + + cacheTerm(spo.o(), terms); + + if (spo.c() != null) { + + cacheTerm(spo.c(), terms); + + } + + } + + /** + * We need to cache the BigdataValues on the IV components within the + * SidIV so that the SidIV can materialize itself into a BigdataBNode + * properly. + */ + @SuppressWarnings({ "unchecked", "rawtypes" }) + final private void cacheTerm(final IV iv, + final Map<IV<?, ?>, BigdataValue> terms) { + + if (iv instanceof SidIV) { + + cacheTerms((SidIV<?>) iv, terms); + + } else { + + iv.setValue(terms.get(iv)); + + } + + } + + /** * Recently resolved term identifiers are cached to improve performance when * externalizing statements. * Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataBindingSetResolverator.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataBindingSetResolverator.java 2014-03-12 14:28:25 UTC (rev 7941) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataBindingSetResolverator.java 2014-03-12 17:47:35 UTC (rev 7942) @@ -21,8 +21,10 @@ import com.bigdata.rdf.internal.IV; import com.bigdata.rdf.internal.impl.BlobIV; import com.bigdata.rdf.internal.impl.TermId; +import com.bigdata.rdf.internal.impl.bnode.SidIV; import com.bigdata.rdf.lexicon.LexiconRelation; import com.bigdata.rdf.model.BigdataValue; +import com.bigdata.rdf.spo.ISPO; import com.bigdata.relation.accesspath.BlockingBuffer; import com.bigdata.striterator.AbstractChunkedResolverator; import com.bigdata.striterator.IChunkedOrderedIterator; @@ -218,10 +220,13 @@ } - if (iv.hasValue()) - continue; - ids.add(iv); + handleIV(iv, ids); + +// if (iv.hasValue()) +// continue; +// +// ids.add(iv); } @@ -244,11 +249,13 @@ } - if (iv.hasValue()) - continue; - - ids.add(iv); - +// if (iv.hasValue()) +// continue; +// +// ids.add(iv); + + handleIV(iv, ids); + } } @@ -302,7 +309,50 @@ } } + + /** + * Add the IV to the list of terms to materialize, and also + * delegate to {@link #handleSid(SidIV, Collection, boolean)} if it's a + * SidIV. + */ + static private void handleIV(final IV<?, ?> iv, + final Collection<IV<?, ?>> ids) { + + if (iv instanceof SidIV) { + + handleSid((SidIV<?>) iv, ids); + + } + + ids.add(iv); + + } + + /** + * Sids need to be handled specially because their individual ISPO + * components might need materialization as well. + */ + static private void handleSid(final SidIV<?> sid, + final Collection<IV<?, ?>> ids) { + + final ISPO spo = sid.getInlineValue(); + + handleIV(spo.s(), ids); + + handleIV(spo.p(), ids); + + handleIV(spo.o(), ids); + + if (spo.c() != null) { + + handleIV(spo.c(), ids); + + } + } + + + /** * Resolve the term identifiers in the {@link IBindingSet} using the map * populated when we fetched the current chunk and return the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-12 14:28:27
|
Revision: 7941 http://sourceforge.net/p/bigdata/code/7941 Author: mrpersonick Date: 2014-03-12 14:28:25 +0000 (Wed, 12 Mar 2014) Log Message: ----------- Fixed the ntriples parser to write the RDR statement inside the <<>>. Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/ntriples/BigdataNTriplesParser.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/ntriples/BigdataNTriplesParser.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/ntriples/BigdataNTriplesParser.java 2014-03-12 14:26:12 UTC (rev 7940) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/ntriples/BigdataNTriplesParser.java 2014-03-12 14:28:25 UTC (rev 7941) @@ -422,6 +422,9 @@ BigdataStatement st = (BigdataStatement) createStatement( state.subject, state.predicate, state.object); + // add the RDR statement inside the << >>. + rdfHandler.handleStatement(st); + state.lastSID = ((BigdataValueFactory) valueFactory).createBNode(st); // // Resolve against LRU map to blank node for statement. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-12 14:26:16
|
Revision: 7940 http://sourceforge.net/p/bigdata/code/7940 Author: mrpersonick Date: 2014-03-12 14:26:12 +0000 (Wed, 12 Mar 2014) Log Message: ----------- Fixed the turtle parser to write the RDR statement inside the <<>>. Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleParser.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleParser.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleParser.java 2014-03-12 13:26:39 UTC (rev 7939) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/rio/turtle/BigdataTurtleParser.java 2014-03-12 14:26:12 UTC (rev 7940) @@ -14,6 +14,7 @@ import org.openrdf.model.URI; import org.openrdf.model.Value; import org.openrdf.model.ValueFactory; +import org.openrdf.rio.RDFHandlerException; import org.openrdf.rio.RDFParseException; import org.openrdf.rio.turtle.TurtleParser; import org.openrdf.rio.turtle.TurtleUtil; @@ -864,10 +865,18 @@ throw new RDFParseException( "You must set a ValueFactory to use the RDR syntax"); } + + try { + // write the RDR statement + reportStatement(s, p, o); + } catch (RDFHandlerException ex) { + throw new IOException(ex); + } + return valueFactory.createBNode(valueFactory.createStatement(s, p, o)); } else { reportError("expecting >> to close statement identifier"); - throw new IOException(); + throw new IOException("expecting >> to close statement identifier"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-12 13:26:44
|
Revision: 7939 http://sourceforge.net/p/bigdata/code/7939 Author: thompsonbry Date: 2014-03-12 13:26:39 +0000 (Wed, 12 Mar 2014) Log Message: ----------- Fix for bad import (from jetty, rather than openrdf). Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/BigdataGASState.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/BigdataGASState.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/BigdataGASState.java 2014-03-12 01:40:31 UTC (rev 7938) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/BigdataGASState.java 2014-03-12 13:26:39 UTC (rev 7939) @@ -6,8 +6,8 @@ import java.util.Set; import org.apache.log4j.Logger; -import org.eclipse.jetty.util.ajax.JSON.Literal; import org.openrdf.model.BNode; +import org.openrdf.model.Literal; import org.openrdf.model.Statement; import org.openrdf.model.URI; import org.openrdf.model.Value; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-12 01:40:36
|
Revision: 7938 http://sourceforge.net/p/bigdata/code/7938 Author: tobycraig Date: 2014-03-12 01:40:31 +0000 (Wed, 12 Mar 2014) Log Message: ----------- #843 - Download service description for namespace, after confirmation from user Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 01:28:26 UTC (rev 7937) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 01:40:31 UTC (rev 7938) @@ -59,7 +59,7 @@ } else { use = '<a href="#" class="use-namespace">Use</a>'; } - $('#namespaces-list').append('<li data-name="' + title + '" data-url="' + url + '">' + titleText + ' - ' + use + ' - <a href="#" class="delete-namespace">Delete</a> - <a href="#" class="namespace-properties">Properties</a></li>'); + $('#namespaces-list').append('<li data-name="' + title + '" data-url="' + url + '">' + titleText + ' - ' + use + ' - <a href="#" class="delete-namespace">Delete</a> - <a href="#" class="namespace-properties">Properties</a> - <a href="/bigdata/namespace/' + title + '/sparql" class="namespace-service-description">Service Description</a></li>'); } $('.use-namespace').click(function(e) { e.preventDefault(); @@ -73,6 +73,9 @@ e.preventDefault(); getNamespaceProperties($(this).parent().data('name')); }); + $('.namespace-service-description').click(function(e) { + return confirm('This can be an expensive operation. Proceed anyway?'); + }); }); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-12 01:28:34
|
Revision: 7937 http://sourceforge.net/p/bigdata/code/7937 Author: tobycraig Date: 2014-03-12 01:28:26 +0000 (Wed, 12 Mar 2014) Log Message: ----------- #843 - Added download VoID link to namespaces Modified Paths: -------------- branches/RDR/bigdata-war/src/html/new.html Modified: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html 2014-03-12 01:13:11 UTC (rev 7936) +++ branches/RDR/bigdata-war/src/html/new.html 2014-03-12 01:28:26 UTC (rev 7937) @@ -164,6 +164,8 @@ <div class="box"> <h1>Namespaces</h1> <ul id="namespaces-list"></ul> + <br> + <a href="/bigdata/namespace">Download VoID description of all namespaces</a> </div> <div id="namespace-properties" class="box"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-12 01:13:16
|
Revision: 7936 http://sourceforge.net/p/bigdata/code/7936 Author: tobycraig Date: 2014-03-12 01:13:11 +0000 (Wed, 12 Mar 2014) Log Message: ----------- #845 - Added Properties link to namespaces allowing user to view a namespace's properties Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/js/workbench.js branches/RDR/bigdata-war/src/html/new.html Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-03-12 00:22:02 UTC (rev 7935) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-03-12 01:13:11 UTC (rev 7936) @@ -181,3 +181,6 @@ font-family: monospace; } +#namespace-details { + display: none; +} Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 00:22:02 UTC (rev 7935) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 01:13:11 UTC (rev 7936) @@ -59,7 +59,7 @@ } else { use = '<a href="#" class="use-namespace">Use</a>'; } - $('#namespaces-list').append('<li data-name="' + title + '" data-url="' + url + '">' + titleText + ' - ' + use + ' - <a href="#" class="delete-namespace">Delete</a></li>'); + $('#namespaces-list').append('<li data-name="' + title + '" data-url="' + url + '">' + titleText + ' - ' + use + ' - <a href="#" class="delete-namespace">Delete</a> - <a href="#" class="namespace-properties">Properties</a></li>'); } $('.use-namespace').click(function(e) { e.preventDefault(); @@ -69,6 +69,10 @@ e.preventDefault(); deleteNamespace($(this).parent().data('name')); }); + $('.namespace-properties').click(function(e) { + e.preventDefault(); + getNamespaceProperties($(this).parent().data('name')); + }); }); } @@ -99,6 +103,18 @@ } } +function getNamespaceProperties(namespace) { + $('#namespace-properties h1').html(namespace); + $('#namespace-properties ul').empty(); + $('#namespace-properties').show(); + var url = '/bigdata/namespace/' + namespace + '/properties'; + $.get(url, function(data) { + $.each(data.getElementsByTagName('entry'), function(i, entry) { + $('#namespace-properties ul').append('<li>' + entry.getAttribute('key') + ': ' + entry.textContent + '</li>'); + }); + }); +} + function createNamespace(e) { e.preventDefault(); var input = $(this).find('input[type=text]'); Modified: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html 2014-03-12 00:22:02 UTC (rev 7935) +++ branches/RDR/bigdata-war/src/html/new.html 2014-03-12 01:13:11 UTC (rev 7936) @@ -166,6 +166,11 @@ <ul id="namespaces-list"></ul> </div> + <div id="namespace-properties" class="box"> + <h1></h1> + <ul></ul> + </div> + <div class="box"> <form id="namespace-create"><input type="text"> <input type="submit" value="Create namespace"></form> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-12 00:22:08
|
Revision: 7935 http://sourceforge.net/p/bigdata/code/7935 Author: tobycraig Date: 2014-03-12 00:22:02 +0000 (Wed, 12 Mar 2014) Log Message: ----------- #836 - Moved create namespace to its own box, added header, tweaked behaviour Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/js/workbench.js branches/RDR/bigdata-war/src/html/new.html Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-03-11 21:49:22 UTC (rev 7934) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-03-12 00:22:02 UTC (rev 7935) @@ -54,6 +54,11 @@ margin: 10px; } +h1 { + font-size: 125%; + margin-bottom: 10px; +} + #container { /*max-width: 600px;*/ } Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 21:49:22 UTC (rev 7934) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-12 00:22:02 UTC (rev 7935) @@ -53,7 +53,13 @@ var title = namespaces[i].getElementsByTagName('title')[0].textContent; var titleText = title == DEFAULT_NAMESPACE ? title + ' (default)' : title; var url = namespaces[i].getElementsByTagName('sparqlEndpoint')[0].getAttributeNS(rdf, 'resource'); - $('#namespaces-list').append('<li data-name="' + title + '" data-url="' + url + '">' + titleText + ' - <a href="#" class="use-namespace">Use</a> - <a href="#" class="delete-namespace">Delete</a></li>'); + var use; + if(title == NAMESPACE) { + use = 'In use'; + } else { + use = '<a href="#" class="use-namespace">Use</a>'; + } + $('#namespaces-list').append('<li data-name="' + title + '" data-url="' + url + '">' + titleText + ' - ' + use + ' - <a href="#" class="delete-namespace">Delete</a></li>'); } $('.use-namespace').click(function(e) { e.preventDefault(); @@ -95,7 +101,8 @@ function createNamespace(e) { e.preventDefault(); - var namespace = $(this).find('input').val(); + var input = $(this).find('input[type=text]'); + var namespace = input.val(); if(!namespace) { return; } @@ -106,7 +113,7 @@ type: 'POST', data: data, contentType: 'application/xml', - success: getNamespaces, + success: function() { input.val(''); getNamespaces(); }, error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } }; $.ajax('/bigdata/namespace', settings); Modified: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html 2014-03-11 21:49:22 UTC (rev 7934) +++ branches/RDR/bigdata-war/src/html/new.html 2014-03-12 00:22:02 UTC (rev 7935) @@ -162,10 +162,11 @@ <div class="tab" id="namespaces-tab"> <div class="box"> - <ul id="namespaces-list"> + <h1>Namespaces</h1> + <ul id="namespaces-list"></ul> + </div> - </ul> - + <div class="box"> <form id="namespace-create"><input type="text"> <input type="submit" value="Create namespace"></form> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-11 21:49:25
|
Revision: 7934 http://sourceforge.net/p/bigdata/code/7934 Author: tobycraig Date: 2014-03-11 21:49:22 +0000 (Tue, 11 Mar 2014) Log Message: ----------- #819 - Use new, less resource-intensive URL for retrieving namespaces Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 21:47:42 UTC (rev 7933) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 21:49:22 UTC (rev 7934) @@ -45,7 +45,7 @@ /* Namespaces */ function getNamespaces() { - $.get('/bigdata/namespace', function(data) { + $.get('/bigdata/namespace?describe-each-named-graph=false', function(data) { $('#namespaces-list').empty(); var rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; var namespaces = namespaces = data.getElementsByTagNameNS(rdf, 'Description') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-11 21:47:46
|
Revision: 7933 http://sourceforge.net/p/bigdata/code/7933 Author: tobycraig Date: 2014-03-11 21:47:42 +0000 (Tue, 11 Mar 2014) Log Message: ----------- #844 - Fixed erroneous selector for retrieving default namespace Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 20:53:18 UTC (rev 7932) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 21:47:42 UTC (rev 7933) @@ -116,7 +116,7 @@ function getDefaultNamespace() { $.get('/bigdata/namespace?describe-each-named-graph=false&describe-default-namespace=true', function(data) { // Chrome does not work with rdf\:Description, so look for Description too - var defaultDataset = $(data).find('rdf\\:Description[rdf\\:nodeID=defaultDataset], Description[rdf\\:nodeID=defaultDataset]'); + var defaultDataset = $(data).find('rdf\\:Description, Description'); DEFAULT_NAMESPACE = defaultDataset.find('title')[0].textContent; var url = defaultDataset.find('sparqlEndpoint')[0].attributes['rdf:resource'].textContent; useNamespace(DEFAULT_NAMESPACE, url); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |