Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

MARMOTTA-659: Port Marmotta to Eclipse RDF4J #31

Open
wants to merge 73 commits into
base: MARMOTTA-659_port_rdf4j
Choose a base branch
from

Conversation

cuent
Copy link
Member

@cuent cuent commented Jul 26, 2017

Marmotta is compiling with RDF4J. Before merging, I'd like to make a consensus about the following problems:

  • Create issues for managing special data types such as NaN, -INF, and INF, and find an alternative for LDP Test suite. Have this issues to be created after merging into the branch develop or before?
  • What's going to happen with experimental backends that use TinkerPop 2.x?
  • Name conventions, change Sesame for RDF4J in modules, class names, and dependencies.
  • Should we ignore two new tests in RDF4J for large transactions; they are passing but take too long.

Once that it's solved, I think we're ready to go at least that anyone has other suggestions.

ajs6f and others added 30 commits March 31, 2017 17:08
Add MYSQL and postreSQL with its respective tables.

Signed-off-by: Xavier Sumba
1. KiWiSailConnection make use of EvaluationStrategyImpl which now needs FederatedServiceResolver to manage FederatedServices.
2. RepositoryConnectionTest needs an IsolationLevel, using SNAPSHOT_READ level by default. Sesame 2.8.11 intruduces Isolation Levels, so is not necessary to test testReadOfAddedStatement1 and testReadOfAddedStatement2.
3. Constructor SailConcurrencyTest does not accepts arguments.

Signed-off-by: Gustavo Mora
…o EvaluationStrategyImpl.

Signed-off-by: Gustavo.
In Sesame 2.8 all literals should have a default value [1], and MemValueFactory does not allow null language tags in the method createLiteral.

[1] https://web.archive.org/web/20160412201829/http://rdf4j.org:80/sesame/2.8/docs/articles/upgrade-notes.docbook?view

Signed-off-by: Gustavo
KiWiValueFactory and RepositoryTest:
- A context is stored in a org.openrdf.query.Dataset variable so is not necessary to send default context in createStatement method.
- All literals are datatyped, so it is necessary to replace for default values (xsd:string or rdf:langString) in case of datatype null [1].
- This changes solves MARMOTTA-39 [2] and as a result, testDeleteTriple in RepositoryTest is passing.

KiWiLiteral
- There is a new implementation of hashCode of literals in Sesame 2.8, which includes language and datatype. Old implementation in [3], new implementation in [4].

[1] https://web.archive.org/web/20160412201829/http://rdf4j.org:80/sesame/2.8/docs/articles/upgrade-notes.docbook?view
[2] https://issues.apache.org/jira/browse/MARMOTTA-39
[3] https://bitbucket.org/openrdf/sesame/src/11f1f0e681cea47e167bd79929873370e199a19f/core/model/src/main/java/org/openrdf/model/impl/LiteralImpl.java?at=2.7.x&fileviewer=file-view-default
[4] https://bitbucket.org/openrdf/sesame/src/aa292b3bee427c1a549b89a099a58d7edbe22d5a/core/model/src/main/java/org/openrdf/model/impl/LiteralImpl.java?at=2.8.x&fileviewer=file-view-default

Signed-off-by: Gustavo
There was an error while adding two equally statements, but do not commit last addition. The result should be 1, but instead, show 2. This was because method getSize() returned database size + a batch, and because these two statements were the same, result was 2 instead of 1.

Solution: make a flushBatch before each call to getSize() method.

Signed-off-by: Gustavo.
Modification of select query in order to check if the statement exists. This was failing due that value=null is not valid in SQL it should be checked as value is null when a null value is passed.

More info about the agreement to modify query: https://lists.apache.org/[email protected]

Signed-of-by: Gustavo.
For the changes made in [1] is not necessary generate other hash.

Signed-off-by: Gustavo

[1] 8fdf525
Sudo `sudo: required` is necessary to get a beefier execution environment and build is failing from branch develop; tried with versions of MySQL 5.5, 5.6, and 5.7.
Signed-off-by: Gustavo
1. Some interfaces are deprecated, use AbstractQueryModelVisitor instead of QueryModelVisitorBase.
2. And implementations of URIImpl, BNodeImpl, etc are deprecated, use ValueFactory instead.

Signed-off-by: Gustavo.
Now hashCode() in literals does not include language and datatype.

More details eclipse-rdf4j/rdf4j#668
1. Some interfaces are deprecated, use AbstractRDFHandler instead of RDFHandlerBase and AbstractRDFParser  instead of RDFParserBase .

2. And implementations of URIImpl, BNodeImpl, etc are deprecated, use ValueFactory instead.

3. Some methods in QueryResultIO and AbstractRDFParser have changed in Sesame 4.0, adjusting marmotta.

4. Solve conflicts with Optional in Literal, Rio and RDFParserRegistry.

5. In Sesame 4.0 sesame-queryparser-api is dependency of sesame-queryparser-sparql, adjusting pom file in kiwi-versioning.
json-java integration module for sesame have been removed in favour of sesame-rio-jsonld for Sesame-2.8 and 4.0.

Details in:
https://github.com/jsonld-java/jsonld-java/#2015-08-25
jsonld-java/jsonld-java@2fbe6f6
- Upgrade POM files.
- Modify packages names.
- Rename services filename.

Signed-of-by: Gustavo.
Problems:
It compiles without tests. TinkerPop dependency is deprecated. Upgraded Ostrich, TItan and Accumulo to RDF4J.

Signed-off-by: Gustavo.
Replace deprecated classes and methods : 
NotifyingSailBase -> AbstractNotifyingSail
SimpleEvaluationStrategy -> StrictEvaluationStrategy
StatementImpl -> SimpleValueFactory.getInstance().createStatement
EvaluationStrategyImpl -> StrictEvaluationStrategy
ObjectUtils.equals -> Objects.equals
TemplateMethodModel ->TemplateMethodModelEx
IOUtils.toString(InputStream) -> IOUtils.toString(InputStream, Charset)
IOUtils.toInputStream(String) -> IOUtils.toInputStream(String, Charset)
IOUtils.readLines(InputStream) -> IOUtils.readLines(InputStream, Charset)

Renamed packages
org.eclipse.rdf4j.query.algebra.evaluation.function.* -> org.eclipse.rdf4j.query.algebra.evaluation.function.xsd.*

Upgraded JUnit
junit.version 4.11 -> 4.12
Replace deprecated classes : 
TupleQueryResultHandlerBase>AbstractTupleQueryResultHandler
KiwiUriResourse > KiwiIriResource
URICommons > IRICommons
URIFunnel > IRIFunnel
…s to original java.util. Now that all imports are working, older dependecias are changed.

Signed-off-by: Gustavo.
@wikier
Copy link
Member

wikier commented Jul 26, 2017

@gmora1223, I would point this PR to MARMOTTA-659_port_rdf4j (https://git-wip-us.apache.org/repos/asf?p=marmotta.git;a=shortlog;h=refs/heads/MARMOTTA-659_port_rdf4j) rather than develop for now.

@cuent cuent changed the base branch from develop to MARMOTTA-659_port_rdf4j July 26, 2017 15:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants