Skip to content

Commit 02a2b4e

Browse files
committed
We have come to a clearly understanding of the service registry pattern based on inspection of the Sesame code base and the java.util.ServiceLoader class. This pattern is sufficient for declaring new service providers, such as the NQuadsParser, but does not provide any mechanism for replacing existing service providers for the same "key". In particular, it appears likely that the service providers are registered in something like their classpath ordering. This means that we can not rely on this META-INF/services pattern to replace the Sesame RDF/XML parser with our own. This implies that we need to intervene in one or more locations and ensure that the Sesame RDF/XML parser is replaced by our RDF/XML parser (which supports SIDs and statement enum interchange). (The alternative is to register our parser under a new MIME type, which would be a different key. However, that leads to problems where our version of the parser is not used before the RDF/XML is not appropriately marked with the extension MIME type.)
The SPARQL parser does not have these problems because we explicitly create an instance without use of the service registry pattern. Also, the Bigdata2ASTSPARQLParser class does not have a zero argument constructor (it requires a reference to the database) and is therefore not compatible with the service registry pattern. I have added a META-INF/services declaration for the NQuadsParser, an NQuadsParserFactory, and a test suite to verify the ability to resolve an NQuadsParserFactory and NQuadsParser using the service provider pattern. I commented out the code in the static initialization of NQuadsParser which was responsible for registering the NQuadsParser's inner parser factory class. I verified that resolution now takes place through the service provider pattern in the IDE when the META-INF directory structure is part of the classpath. The nquads support has been moved into the com.bigdata.rdf.rio.nquads package to follow the general package naming pattern for rio/openrdf. The bigdata RDF/XML parser has been moved to the com.bigdata.rdf.rio.rdfxml package and various package private classes have been imported to support the parser since they are no longer visible now that the package namespace has changed. The RDF/XML parser/write classes have also been renamed to begin "Bigdata" so there can no longer be any confusion about which parser/writer is being used. A Bigdata RDF/XML writer factory class has been added. META-INF/services entries have been added for the RDF/XML parser/writer, but as noted above, those entries are NOT sufficient to guarantee resolution of the correct service provider. com.bigdata.rdf.ServiceProviderHook has been added. The NQuadsParser#forceLoad() method has been refactored into ServiceProviderHook which is used to enforce certain overrides (replacements) of the default services registered by Sesame. This also ensures that RDFFormats declared by bigdata are registered with openrdf (notably the NQUADS format). I modified several places in the bigdata code base where we were directly using the bigdata specific RDFXMLWriter or RDFXMLParser to use the service registry mechanism instead (since the class names were changed, the hard coded references were picking up the wrong class). When those places were in the test suite, I added asserts to verify that the bigdata extension classes were being used. The "compile" target in build.xml has been modified to also copy the META-INF/services directory for the bigdata-rdf package. I have verified the "compile" target causes the output META-INF directory to contain all of the desired META-INF/services files. The TestLocalTripleStore and TestBigdataSailWithQuads test suites are green. The next step is to refactor the SPARQL parser classes in order to avoid similar class path problems arising from using the same package name as openrdf. After than I will open up the SPARQL grammar for changes to support property paths and UPDATE. @see https://sourceforge.net/apps/trac/bigdata/ticket/439 (Class path problems) git-svn-id: svn+ssh://svn.code.sf.net/p/bigdata/code/branches/BIGDATA_RELEASE_1_1_0@6045 8f7bc0f5-282e-0410-95e3-8d296e9bb460
1 parent 10fd926 commit 02a2b4e

35 files changed

+1171
-164
lines changed

.classpath

+75-74
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,75 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<classpath>
3-
<classpathentry kind="src" path="bigdata-rdf/src/java"/>
4-
<classpathentry kind="src" path="bigdata-rdf/src/samples"/>
5-
<classpathentry kind="src" path="dsi-utils/src/java"/>
6-
<classpathentry kind="src" path="bigdata/src/resources/logging"/>
7-
<classpathentry kind="src" path="bigdata-sails/src/samples"/>
8-
<classpathentry kind="src" path="bigdata-jini/src/test"/>
9-
<classpathentry kind="src" path="bigdata-sails/src/java"/>
10-
<classpathentry kind="src" path="bigdata/src/java"/>
11-
<classpathentry kind="src" path="bigdata-rdf/src/test"/>
12-
<classpathentry kind="src" path="bigdata/src/test"/>
13-
<classpathentry kind="src" path="bigdata-sails/src/test"/>
14-
<classpathentry kind="src" path="bigdata-jini/src/java"/>
15-
<classpathentry kind="src" path="contrib/src/problems"/>
16-
<classpathentry kind="src" path="bigdata/src/samples"/>
17-
<classpathentry kind="src" path="dsi-utils/src/test"/>
18-
<classpathentry kind="src" path="ctc-striterators/src/java"/>
19-
<classpathentry kind="src" path="ctc-striterators/src/test"/>
20-
<classpathentry kind="src" path="junit-ext/src/test"/>
21-
<classpathentry kind="src" path="junit-ext/src/java"/>
22-
<classpathentry kind="src" path="lgpl-utils/src/java"/>
23-
<classpathentry kind="src" path="lgpl-utils/src/test"/>
24-
<classpathentry kind="src" path="bigdata-war/src"/>
25-
<classpathentry kind="src" path="bigdata-ganglia/src/java"/>
26-
<classpathentry kind="src" path="bigdata-ganglia/src/test"/>
27-
<classpathentry exported="true" kind="lib" path="bigdata/lib/dsi-utils-1.0.6-020610.jar"/>
28-
<classpathentry exported="true" kind="lib" path="bigdata/lib/lgpl-utils-1.0.6-020610.jar"/>
29-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/apache/zookeeper-3.3.3.jar"/>
30-
<classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/nxparser-6-22-2010.jar"/>
31-
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-continuation-7.2.2.v20101205.jar"/>
32-
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-http-7.2.2.v20101205.jar"/>
33-
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-io-7.2.2.v20101205.jar"/>
34-
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-server-7.2.2.v20101205.jar"/>
35-
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-util-7.2.2.v20101205.jar"/>
36-
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/servlet-api-2.5.jar"/>
37-
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-servlet-7.2.2.v20101205.jar"/>
38-
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-security-7.2.2.v20101205.jar"/>
39-
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-webapp-7.2.2.v20101205.jar"/>
40-
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-xml-7.2.2.v20101205.jar"/>
41-
<classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/colt-1.2.0.jar"/>
42-
<classpathentry exported="true" kind="lib" path="bigdata/lib/junit-3.8.1.jar" sourcepath="/root/.m2/repository/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
43-
<classpathentry exported="true" kind="lib" path="bigdata/lib/apache/log4j-1.2.15.jar"/>
44-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/browser.jar"/>
45-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/classserver.jar"/>
46-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/fiddler.jar"/>
47-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jini-core.jar"/>
48-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jini-ext.jar"/>
49-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-lib.jar"/>
50-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-platform.jar"/>
51-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-resources.jar"/>
52-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/mahalo.jar"/>
53-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/mercury.jar"/>
54-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/norm.jar"/>
55-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/outrigger.jar"/>
56-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/reggie.jar"/>
57-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/start.jar"/>
58-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/sun-util.jar"/>
59-
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/tools.jar"/>
60-
<classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/fastutil-5.1.5.jar"/>
61-
<classpathentry exported="true" kind="lib" path="bigdata/lib/lucene/lucene-analyzers-3.0.0.jar"/>
62-
<classpathentry exported="true" kind="lib" path="bigdata/lib/lucene/lucene-core-3.0.0.jar"/>
63-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
64-
<classpathentry exported="true" kind="lib" path="bigdata/lib/high-scale-lib-v1.1.2.jar"/>
65-
<classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-4_8.jar"/>
66-
<classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-charset-4_8.jar"/>
67-
<classpathentry exported="true" kind="lib" path="bigdata/lib/junit-ext-1.1-b3-dev.jar"/>
68-
<classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/slf4j-api-1.6.1.jar"/>
69-
<classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/slf4j-log4j12-1.6.1.jar"/>
70-
<classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/openrdf-sesame-2.5.0-onejar.jar" sourcepath="/org.openrdf.sesame-2.5.0"/>
71-
<classpathentry kind="lib" path="bigdata-sails/lib/sesame-sparql-testsuite-2.5.0.jar" sourcepath="/org.openrdf.sesame-2.5.0"/>
72-
<classpathentry kind="lib" path="bigdata-sails/lib/sesame-store-testsuite-2.5.0.jar" sourcepath="/org.openrdf.sesame-2.5.0"/>
73-
<classpathentry kind="output" path="bin"/>
74-
</classpath>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="bigdata-rdf/src/java"/>
4+
<classpathentry kind="src" path="bigdata-rdf/src/samples"/>
5+
<classpathentry kind="src" path="dsi-utils/src/java"/>
6+
<classpathentry kind="src" path="bigdata/src/resources/logging"/>
7+
<classpathentry kind="src" path="bigdata-sails/src/samples"/>
8+
<classpathentry kind="src" path="bigdata-jini/src/test"/>
9+
<classpathentry kind="src" path="bigdata-sails/src/java"/>
10+
<classpathentry kind="src" path="bigdata/src/java"/>
11+
<classpathentry kind="src" path="bigdata-rdf/src/test"/>
12+
<classpathentry kind="src" path="bigdata/src/test"/>
13+
<classpathentry kind="src" path="bigdata-sails/src/test"/>
14+
<classpathentry kind="src" path="bigdata-jini/src/java"/>
15+
<classpathentry kind="src" path="contrib/src/problems"/>
16+
<classpathentry kind="src" path="bigdata/src/samples"/>
17+
<classpathentry kind="src" path="dsi-utils/src/test"/>
18+
<classpathentry kind="src" path="ctc-striterators/src/java"/>
19+
<classpathentry kind="src" path="ctc-striterators/src/test"/>
20+
<classpathentry kind="src" path="junit-ext/src/test"/>
21+
<classpathentry kind="src" path="junit-ext/src/java"/>
22+
<classpathentry kind="src" path="lgpl-utils/src/java"/>
23+
<classpathentry kind="src" path="lgpl-utils/src/test"/>
24+
<classpathentry kind="src" path="bigdata-war/src"/>
25+
<classpathentry kind="src" path="bigdata-ganglia/src/java"/>
26+
<classpathentry kind="src" path="bigdata-ganglia/src/test"/>
27+
<classpathentry kind="src" path="bigdata-rdf/src/resources/service-providers"/>
28+
<classpathentry exported="true" kind="lib" path="bigdata/lib/dsi-utils-1.0.6-020610.jar"/>
29+
<classpathentry exported="true" kind="lib" path="bigdata/lib/lgpl-utils-1.0.6-020610.jar"/>
30+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/apache/zookeeper-3.3.3.jar"/>
31+
<classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/nxparser-6-22-2010.jar"/>
32+
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-continuation-7.2.2.v20101205.jar"/>
33+
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-http-7.2.2.v20101205.jar"/>
34+
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-io-7.2.2.v20101205.jar"/>
35+
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-server-7.2.2.v20101205.jar"/>
36+
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-util-7.2.2.v20101205.jar"/>
37+
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/servlet-api-2.5.jar"/>
38+
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-servlet-7.2.2.v20101205.jar"/>
39+
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-security-7.2.2.v20101205.jar"/>
40+
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-webapp-7.2.2.v20101205.jar"/>
41+
<classpathentry exported="true" kind="lib" path="bigdata/lib/jetty/jetty-xml-7.2.2.v20101205.jar"/>
42+
<classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/colt-1.2.0.jar"/>
43+
<classpathentry exported="true" kind="lib" path="bigdata/lib/junit-3.8.1.jar" sourcepath="/root/.m2/repository/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
44+
<classpathentry exported="true" kind="lib" path="bigdata/lib/apache/log4j-1.2.15.jar"/>
45+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/browser.jar"/>
46+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/classserver.jar"/>
47+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/fiddler.jar"/>
48+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jini-core.jar"/>
49+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jini-ext.jar"/>
50+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-lib.jar"/>
51+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-platform.jar"/>
52+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-resources.jar"/>
53+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/mahalo.jar"/>
54+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/mercury.jar"/>
55+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/norm.jar"/>
56+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/outrigger.jar"/>
57+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/reggie.jar"/>
58+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/start.jar"/>
59+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/sun-util.jar"/>
60+
<classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/tools.jar"/>
61+
<classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/fastutil-5.1.5.jar"/>
62+
<classpathentry exported="true" kind="lib" path="bigdata/lib/lucene/lucene-analyzers-3.0.0.jar"/>
63+
<classpathentry exported="true" kind="lib" path="bigdata/lib/lucene/lucene-core-3.0.0.jar"/>
64+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
65+
<classpathentry exported="true" kind="lib" path="bigdata/lib/high-scale-lib-v1.1.2.jar"/>
66+
<classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-4_8.jar"/>
67+
<classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-charset-4_8.jar"/>
68+
<classpathentry exported="true" kind="lib" path="bigdata/lib/junit-ext-1.1-b3-dev.jar"/>
69+
<classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/slf4j-api-1.6.1.jar"/>
70+
<classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/slf4j-log4j12-1.6.1.jar"/>
71+
<classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/openrdf-sesame-2.5.0-onejar.jar" sourcepath="/org.openrdf.sesame-2.6.1"/>
72+
<classpathentry kind="lib" path="bigdata-sails/lib/sesame-sparql-testsuite-2.5.0.jar" sourcepath="/org.openrdf.sesame-2.5.0"/>
73+
<classpathentry kind="lib" path="bigdata-sails/lib/sesame-store-testsuite-2.5.0.jar" sourcepath="/org.openrdf.sesame-2.5.0"/>
74+
<classpathentry kind="output" path="bin"/>
75+
</classpath>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
/**
2+
3+
Copyright (C) SYSTAP, LLC 2006-2012. All rights reserved.
4+
5+
Contact:
6+
SYSTAP, LLC
7+
4501 Tower Road
8+
Greensboro, NC 27410
9+
10+
11+
This program is free software; you can redistribute it and/or modify
12+
it under the terms of the GNU General Public License as published by
13+
the Free Software Foundation; version 2 of the License.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU General Public License for more details.
19+
20+
You should have received a copy of the GNU General Public License
21+
along with this program; if not, write to the Free Software
22+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23+
*/
24+
/*
25+
* Created on Feb 27, 2012
26+
*/
27+
28+
package com.bigdata.rdf;
29+
30+
import info.aduna.lang.service.ServiceRegistry;
31+
32+
import java.util.ServiceLoader;
33+
34+
import org.openrdf.query.QueryLanguage;
35+
import org.openrdf.rio.RDFFormat;
36+
import org.openrdf.rio.RDFParserRegistry;
37+
import org.openrdf.rio.RDFWriterRegistry;
38+
39+
import com.bigdata.rdf.model.StatementEnum;
40+
import com.bigdata.rdf.rio.nquads.NQuadsParser;
41+
import com.bigdata.rdf.rio.rdfxml.BigdataRDFXMLParserFactory;
42+
import com.bigdata.rdf.rio.rdfxml.BigdataRDFXMLWriterFactory;
43+
44+
/**
45+
* This static class provides a hook which allows the replacement of services
46+
* registered via the openrdf {@link ServiceRegistry} pattern which makes use of
47+
* the same underlying pattern which is disclosed by the {@link ServiceLoader}.
48+
* <p>
49+
* The {@link ServiceRegistry} pattern provides a declarative association
50+
* between a service and a service provider. The service declarations are
51+
* located in <code>META-INF/services/</code> packages. Each file in such a
52+
* package name the service interface and the contents of the file name the
53+
* service provider(s). The set of all such service provides located in all such
54+
* service packages is registered for a given service interface. For openrdf,
55+
* the service provides are initially associated with a <i>key</i>, such as an
56+
* {@link RDFFormat}, {@link QueryLanguage}, etc.
57+
* <p>
58+
* However, this service registration pattern does not support the specification
59+
* of a <em>preferred</em> service provider. In the context of multiple service
60+
* providers for the same <i>key</i> and service interface, there is no way to
61+
* control which service provider will remain in the {@link ServiceRegistry}.
62+
* <p>
63+
* This effects things such as the bigdata extension for the RDF/XML parser
64+
* which adds support for SIDs mode interchange and the interchange of
65+
* {@link StatementEnum} metadata.
66+
* <p>
67+
* This class is used to "hook" the various service registeries and force the
68+
* use of the bigdata extension when it adds semantics not present in the base
69+
* service provider implementation. For such "hooked" services providers, the
70+
* service registry pattern using <code>META-INF/services</code> is not
71+
* manditory, but following the pattern is never the less recommended.
72+
*
73+
* @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/439">Class
74+
* loader problems </a>
75+
*
76+
* @author <a href="mailto:[email protected]">Bryan Thompson</a>
77+
* @version $Id$
78+
*/
79+
public class ServiceProviderHook {
80+
81+
static private boolean loaded = false;
82+
static {
83+
forceLoad();
84+
}
85+
86+
/**
87+
* This hook may be used to force the load of this class so it can ensure
88+
* that the bigdata version of a service provider is used instead of the
89+
* openrdf version. This is NOT optional. Without this hook, we do not have
90+
* control over which version is resolved last in the processed
91+
* <code>META-INF/services</code> files.
92+
*/
93+
synchronized static public void forceLoad() {
94+
95+
if (loaded)
96+
return;
97+
98+
/*
99+
* Force the class loader to resolve the register, which will cause it
100+
* to be populated with the service provides as declared in the various
101+
* META-INF/services/serviceIface files.
102+
*
103+
* Once that step is known to be complete, we override the service
104+
* provider for RDF/XML.
105+
*/
106+
{
107+
108+
final RDFParserRegistry r = RDFParserRegistry.getInstance();
109+
110+
r.add(new BigdataRDFXMLParserFactory());
111+
112+
// Note: This ensures that the RDFFormat for NQuads is loaded.
113+
r.get(NQuadsParser.nquads);
114+
115+
}
116+
117+
// Ditto, but for the writer.
118+
{
119+
final RDFWriterRegistry r = RDFWriterRegistry.getInstance();
120+
121+
r.add(new BigdataRDFXMLWriterFactory());
122+
123+
}
124+
125+
loaded = true;
126+
127+
}
128+
129+
}

bigdata-rdf/src/java/com/bigdata/rdf/load/MappedRDFDataLoadMaster.java

+12-5
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@
4545
import com.bigdata.journal.IResourceLock;
4646
import com.bigdata.journal.ITx;
4747
import com.bigdata.rawstore.Bytes;
48+
import com.bigdata.rdf.ServiceProviderHook;
4849
import com.bigdata.rdf.inf.ClosureStats;
49-
import com.bigdata.rdf.rio.NQuadsParser;
5050
import com.bigdata.rdf.rio.RDFParserOptions;
51+
import com.bigdata.rdf.rio.nquads.NQuadsParser;
5152
import com.bigdata.rdf.rules.InferenceEngine;
5253
import com.bigdata.rdf.store.AbstractTripleStore;
53-
import com.bigdata.rdf.store.ScaleOutTripleStore;
5454
import com.bigdata.rdf.store.AbstractTripleStore.Options;
55+
import com.bigdata.rdf.store.ScaleOutTripleStore;
5556
import com.bigdata.service.IBigdataClient;
5657
import com.bigdata.service.jini.JiniClient;
5758
import com.bigdata.service.jini.JiniFederation;
@@ -422,12 +423,13 @@ public static class JobState extends MappedTaskMaster.JobState {
422423
* Force the load of the NxParser integration class and its registration
423424
* of the NQuadsParser#nquads RDFFormat.
424425
*
425-
* @todo Should be done via META-INFO.
426+
* @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/439">
427+
* Class loader problems </a>
426428
*/
427429
static {
428430

429431
// Force the load of the NXParser integration.
430-
NQuadsParser.forceLoad();
432+
ServiceProviderHook.forceLoad();
431433

432434
}
433435

@@ -606,7 +608,12 @@ public JobState(final String component, final Configuration config)
606608

607609
if (tmp != null) {
608610

609-
NQuadsParser.forceLoad();
611+
/*
612+
* @see <a
613+
* href="https://sourceforge.net/apps/trac/bigdata/ticket/439"
614+
* > Class loader problems </a>
615+
*/
616+
ServiceProviderHook.forceLoad();
610617

611618
rdfFormat = RDFFormat.valueOf(tmp);
612619

bigdata-rdf/src/java/com/bigdata/rdf/load/RDFFilenameFilter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.apache.log4j.Logger;
88
import org.openrdf.rio.RDFFormat;
99

10-
import com.bigdata.rdf.rio.NQuadsParser;
10+
import com.bigdata.rdf.ServiceProviderHook;
1111

1212
/**
1313
* Filter recognizes anything that is a registered as an {@link RDFFormat} or
@@ -37,7 +37,7 @@ public class RDFFilenameFilter implements FilenameFilter, Serializable {
3737
static {
3838

3939
// Force the load of the NXParser integration.
40-
NQuadsParser.forceLoad();
40+
ServiceProviderHook.forceLoad();
4141

4242
}
4343

bigdata-rdf/src/java/com/bigdata/rdf/rio/BasicRioLoader.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
import org.openrdf.rio.RDFParser;
3838
import org.openrdf.rio.Rio;
3939

40+
import com.bigdata.rdf.ServiceProviderHook;
41+
4042
/**
4143
* Parses data but does not load it into the indices.
4244
*
@@ -55,12 +57,13 @@ public class BasicRioLoader implements IRioLoader {
5557
/**
5658
* Force the load of the NxParser integration class.
5759
*
58-
* @todo Should be done via META-INFO.
60+
* @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/439">
61+
* Class loader problems </a>
5962
*/
6063
static {
6164

6265
// Force the load of the NXParser integration.
63-
NQuadsParser.forceLoad();
66+
ServiceProviderHook.forceLoad();
6467

6568
}
6669

0 commit comments

Comments
 (0)