java.lang.Error: Could not instantiate javax.xml.datatype.DatatypeFactory
at org.eclipse.rdf4j.model.impl.AbstractValueFactory.<clinit>(AbstractValueFactory.java:56)
at org.eclipse.rdf4j.model.impl.SimpleValueFactory.getInstance(SimpleValueFactory.java:31)
at org.eclipse.rdf4j.rio.RDFFormat.<clinit>(RDFFormat.java:71)
at
…..
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl" on path: DexPathList
We did come across this attempt to use RDF4J on Android (https://github.com/MM2-0/rdf4a), but it's inactive a year, and seems to be a full fork, which we'd rather not depend on.
Any help is greatly appreciated, as I'm a big fan of RDF4J :) !
Cheers,
Pat.
--
You received this message because you are subscribed to the Google Groups "RDF4J Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdf4j-users+unsubscribe@googlegroups.com.
To post to this group, send email to rdf4j...@googlegroups.com.
Visit this group at https://groups.google.com/group/rdf4j-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdf4j-users/031d9099-87e2-463b-8e57-0c5086060eaa%40googlegroups.com.
We're not including any jsonld library, i.e. from the Gradle file:
Here's the sample code I tried:compile 'org.eclipse.rdf4j:rdf4j-model:2.2.2'
compile 'org.eclipse.rdf4j:rdf4j-rio-api:2.2.2'
compile ('org.eclipse.rdf4j:rdf4j-util:2.2.2') {
exclude group:'com.google.guava'
}
compile 'org.eclipse.rdf4j:rdf4j-rio-turtle:2.2.2'
String exampleString = "@prefix mc: <http://data.companyy.com/vocab/> .\n" +
"@prefix w3w: <http://data.companyy.com/vocab/3rdparty/what3words#> .\n" +
"@prefix dbpedia: <http://dbpedia.org/resource/> .\n" +
"@prefix schema: <http://schema.org/> .\n" +
"@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n" +
"\n" +
"\n" +
"<http://projectx.companyy.com/id/1> a schema:Person ;\n" +
" mc:coreProfile <http://projectx.companyy.com/id/1/profile/core> .\n" +
"\n" +
"<http://projectx.companyy.com/id/1/profile/core> a mc:CoreProfile ;\n" +
" schema:givenName \"Joe\" ;\n" +
" schema:familyName \"Bloggs\" ;\n" +
" schema:gender \"male\" ;\n" +
" schema:nationality dbpedia:Australia ;\n" +
" mc:maritalStatus \"Married\" ;\n" +
" schema:birthDate \"1990-01-01\"^^xsd:Date ;\n" +
" schema:birthPlace dbpedia:Sydney ;\n" +
" w3w:addr \"camp.road.tent1\" ;\n" +
" schema:spouse <http://projectx.companyy.com/id/67> .\n" +
"\n" +
"\n" +
"\n" +
"<http://projectx.companyy.com/id/67> a schema:Person ;\n" +
" mc:coreProfile <http://projectx.companyy.com/id/67/profile/core> .\n" +
"\n" +
"<http://projectx.companyy.com/id/67/profile/core> a mc:CoreProfile ;\n" +
" schema:givenName \"Jane\" ;\n" +
" schema:familyName \"Bloggs\" ;\n" +
" schema:gender \"female\" ;\n" +
" schema:nationality dbpedia:NewZealand ;\n" +
" mc:maritalStatus \"Married\" ;\n" +
" schema:birthDate \"1995-05-05\"^^xsd:Date ;\n" +
" schema:birthPlace dbpedia:Wellington ;\n" +
" w3w:addr \"camp.road.tent1\" ;\n" +
" schema:spouse <http://projectx.companyy.com/id/1> .";
InputStream stream = null;
try {
stream = new ByteArrayInputStream(exampleString.getBytes(StandardCharsets.UTF_8.name()));
final Model model = Rio.parse(stream, "", RDFFormat.TURTLE);
Log.d("test", "test");
} catch (Exception e) {
e.printStackTrace();
}
But got the same error:
Caused by: javax.xml.datatype.DatatypeConfigurationException: Provider org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl not found
at javax.xml.datatype.DatatypeFactory.newInstance(DatatypeFactory.java:106)
at org.eclipse.rdf4j.model.impl.AbstractValueFactory.<clinit>(AbstractValueFactory.java:53)
at org.eclipse.rdf4j.model.impl.SimpleValueFactory.getInstance(SimpleValueFactory.java:31)
at org.eclipse.rdf4j.rio.RDFFormat.<clinit>(RDFFormat.java:71)