Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/maven/org.apache.maven.plugins…
Browse files Browse the repository at this point in the history
…-maven-compiler-plugin-3.13.0
  • Loading branch information
MaximilianWenzel committed Apr 11, 2024
2 parents 7be5d29 + a948ea2 commit 3652548
Show file tree
Hide file tree
Showing 13 changed files with 118 additions and 92 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/java-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ jobs:
- name: Build with Maven
run: mvn ${{ inputs.maven-options }} -B package --file pom.xml
- name: Prepare artifact for upload
if: github.actor != 'dependabot[bot]'
run: mkdir staging && cp target/*.zip staging
- name: Upload artifact
if: github.actor != 'dependabot[bot]'
uses: actions/upload-artifact@v4
with:
name: maven-build
Expand Down
82 changes: 44 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ SYNOPSIS
neo2rdf dump [--deriveClassHierarchyByLabelSubsetCheck]
[--derivePropertyHierarchyByRelationshipSubsetCheck] [--includeDeletedNeo4jLabels]
[--includeDeletedPropertyKeys] [--includeDeletedRelationshipTypes]
[--basePrefix=<basePrefix>] [-cfg=<conversionConfigFile>] [-d=<neo4jDBDumpPath>]
-db=<neo4jDBDirectory> -o=<outputPath>
[--reificationVocabulary=<reificationVocabulary>]
[--reifyOnlyStatementsWithAnnotations] [--basePrefix=<basePrefix>]
[-cfg=<conversionConfigFile>] [-d=<neo4jDBDumpPath>] -db=<neo4jDBDirectory>
-o=<outputPath> [--reificationVocabulary=<reificationVocabulary>]
[--schemaOutputPath=<schemaOutputPath>]
[--sequenceConversionType=<sequenceConversionType>]
Expand All @@ -103,6 +103,8 @@ OPTIONS
Prefix that is used for all converted nodes, property keys, relationship types,
and relationships.
Default: https://www.example.org/
-cfg, --config=<conversionConfigFile>
Instead of specifying non-mandatory options in terms of command line parameters,
it is also possible to use an external YAML configuration. The YAML keys must
Expand All @@ -112,54 +114,52 @@ OPTIONS
-d, --neo4jDBDumpPath=<neo4jDBDumpPath>
If a path to a Neo4j dump has been specified using this parameter, the DB dump is
extracted to the appropriate target
Neo4j DB directory first, and subsequently, the conversion procedure gets
executed as usual.
-db, --neo4jDBDirectory=<neo4jDBDirectory>, --deriveClassHierarchyByLabelSubsetCheck
Indicates whether the RDF class hierarchy should be derived.
For this purpose, it is examined which sets of Neo4j nodes with an assigned label
are a subset of one another.
--derivePropertyHierarchyByRelationshipSubsetCheck
Indicates whether the RDF property hierarchy should be derived.
For this, the node-node combinations for each relationship type are initially
collected in a set.
Subsequently, for every pair of sets, it is examined whether they are a subset of
each other.
--includeDeletedNeo4jLabels, --includeDeletedPropertyKeys,
--includeDeletedRelationshipTypes, -o, --outputPath=<outputPath>,
--reificationVocabulary=<reificationVocabulary>
The reification vocabulary defines how a quadruple (sbj, pred, obj, statementID)
should be reified in RDF.
should be reified.
Options:
• RDF_REIFICATION: uses the RDF reification vocabulary, i.e., rdf:Statement,
rdf:subject, rdf:predicate, and rdf:object
(cf. https://www.w3.org/TR/rdf11-mt/#reification)
• OWL_REIFICATION: uses the OWL vocabulary, i.e., owl:Axiom,
rdf:annotatedSource, owl:annotatedProperty, and owl:annotatedTarget
(cf. https://www.w3.org/TR/owl2-quick-reference/#Annotations)
• RDF_COLLECTION: Neo4j sequences are converted into open lists in RDF.
Default: OWL_REIFICATION
SEPARATE_LITERALS: Neo4j sequences are converted into separate assertions,
e.g., (x { has: [1, 2] }) is converted to (:x, :has, 1) and (:x, :has, 2).
--reifyOnlyStatementsWithAnnotations
If enabled, whether only statements with annotations should be reified.
--schemaOutputPath=<schemaOutputPath>
If the RDF schema is derived from the Neo4j dataset, e.g., the class or property
hierarchy,
an additional path can be specified to store it separately on disk.
hierarchy, an additional path can be specified to store it separately on disk.
If the value is null or left out, the derived schema is stored along with the
data.
--sequenceConversionType=<sequenceConversionType>
Options:
• RDF_COLLECTION: Neo4j sequences are converted into open lists in RDF.
• SEPARATE_LITERALS: Neo4j sequences are converted into separate assertions,
e.g., (x { has: [1, 2] }) is converted to (:x, :has, 1) and (:x, :has, 2).
Default: RDF_COLLECTION
```


Expand All @@ -176,8 +176,9 @@ SYNOPSIS
neo2rdf server [--deriveClassHierarchyByLabelSubsetCheck]
[--derivePropertyHierarchyByRelationshipSubsetCheck] [--includeDeletedNeo4jLabels]
[--includeDeletedPropertyKeys] [--includeDeletedRelationshipTypes]
[--basePrefix=<basePrefix>] [-cfg=<conversionConfigFile>] [-d=<neo4jDBDumpPath>]
-db=<neo4jDBDirectory> -p=<port> [--reificationVocabulary=<reificationVocabulary>]
[--reifyOnlyStatementsWithAnnotations] [--basePrefix=<basePrefix>]
[-cfg=<conversionConfigFile>] [-d=<neo4jDBDumpPath>] -db=<neo4jDBDirectory> -p=<port>
[--reificationVocabulary=<reificationVocabulary>]
[--schemaOutputPath=<schemaOutputPath>]
[--sequenceConversionType=<sequenceConversionType>] [-t=<numberOfServerThreads>]
Expand All @@ -192,6 +193,8 @@ OPTIONS
Prefix that is used for all converted nodes, property keys, relationship types,
and relationships.
Default: https://www.example.org/
-cfg, --config=<conversionConfigFile>
Instead of specifying non-mandatory options in terms of command line parameters,
it is also possible to use an external YAML configuration. The YAML keys must
Expand All @@ -200,55 +203,58 @@ OPTIONS
-d, --neo4jDBDumpPath=<neo4jDBDumpPath>
If a path to a Neo4j dump has been specified using this parameter, the DB dump is
extracted to the appropriate target
Neo4j DB directory first, and subsequently, the conversion procedure gets
executed as usual.
extracted to the appropriate target Neo4j DB directory first, and subsequently,
the conversion procedure gets executed as usual.
-db, --neo4jDBDirectory=<neo4jDBDirectory>, --deriveClassHierarchyByLabelSubsetCheck
Indicates whether the RDF class hierarchy should be derived.
For this purpose, it is examined which sets of Neo4j nodes with an assigned label
are a subset of one another.
--derivePropertyHierarchyByRelationshipSubsetCheck
Indicates whether the RDF property hierarchy should be derived.
For this, the node-node combinations for each relationship type are initially
collected in a set.
Subsequently, for every pair of sets, it is examined whether they are a subset of
each other.
--includeDeletedNeo4jLabels, --includeDeletedPropertyKeys,
--includeDeletedRelationshipTypes, -p, --port=<port>,
--includeDeletedRelationshipTypes
-p, --port=<port>
Default: 8080
--reificationVocabulary=<reificationVocabulary>
The reification vocabulary defines how a quadruple (sbj, pred, obj, statementID)
should be reified in RDF.
should be reified.
Options:
• RDF_REIFICATION: uses the RDF reification vocabulary, i.e., rdf:Statement,
rdf:subject, rdf:predicate, and rdf:object
(cf. https://www.w3.org/TR/rdf11-mt/#reification)
• OWL_REIFICATION: uses the OWL vocabulary, i.e., owl:Axiom,
rdf:annotatedSource, owl:annotatedProperty, and owl:annotatedTarget
(cf. https://www.w3.org/TR/owl2-quick-reference/#Annotations)
• RDF_COLLECTION: Neo4j sequences are converted into open lists in RDF.
Default: OWL_REIFICATION
SEPARATE_LITERALS: Neo4j sequences are converted into separate assertions,
e.g., (x { has: [1, 2] }) is converted to (:x, :has, 1) and (:x, :has, 2).
--reifyOnlyStatementsWithAnnotations
If this option is set, only Neo4j relationships with properties will be reified in RDF.
--schemaOutputPath=<schemaOutputPath>
If the RDF schema is derived from the Neo4j dataset, e.g., the class or property
hierarchy,
an additional path can be specified to store it separately on disk.
hierarchy, an additional path can be specified to store it separately on disk.
If the value is null or left out, the derived schema is stored along with the
data.
--sequenceConversionType=<sequenceConversionType>
Options:
• RDF_COLLECTION: Neo4j sequences are converted into open lists in RDF.
• SEPARATE_LITERALS: Neo4j sequences are converted into separate assertions,
e.g., (x { has: [1, 2] }) is converted to (:x, :has, 1) and (:x, :has, 2).
Default: RDF_COLLECTION
-t, --numberOfServerThreads=<numberOfServerThreads>
Default: 2
```
8 changes: 8 additions & 0 deletions build-resources/generate-manual/generated-manpages-txt.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Codegen for README CLI manual

# Manual update workflow:
# - build the project locally with maven - $BUILD_DIRECTORY/target/generated-docs now contains autogenerated man pages
# - execute this script which will generate a single manual.txt file from the manual template and autogenerated man pages
# - remove manually from "manual.txt":
# - undesired newline characters that get inserted by the conversion procedure
# - generation date
# - copy "manual.txt" into the README.md (a "git diff" might be helpful)

# adjust width to default maximum GitHub markdown code width
MANWIDTH=95
export MANWIDTH
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<revision>${version}-${sha1}${changelist}-SNAPSHOT</revision>
<version.mvn.plugin.flatten>1.1.0</version.mvn.plugin.flatten>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<neo4j.version>5.15.0</neo4j.version>
<neo4j.version>5.18.1</neo4j.version>
<rdf4j.version>5.0.0-M2</rdf4j.version>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void startProcessing() {

log.info("Processing relationships...");
relationshipProcessor.startProcessing();
this.deployedRelationshipTypes = relationshipProcessor.getDeployedRelationshiptypes();
this.deployedRelationshipTypes = relationshipProcessor.getDeployedRelationshipTypes();
this.annotationPropertyKeys = new UnifiedSet<>(indexedSchema.getPropertyKeyIDToStr().size());
this.annotationPropertyKeys.addAll(relationshipProcessor.getObjectPropertyKeys());
this.annotationPropertyKeys.addAll(relationshipProcessor.getDatatypePropertyKeys());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class RelationshipToRDFConverter extends RelationshipProcessor {
private final Neo4jToRDFMapper neo4jToRDFMapper;
private final ValueFactory valueFactory = new Neo4jToRDFValueFactory();

private Set<Long> deployedRelationshiptypes;
private Set<Long> deployedRelationshipTypes;
private Set<Long> datatypePropertyKeys;
private Set<Long> objectPropertyKeys;
private final ConversionConfig config;
Expand All @@ -40,7 +40,7 @@ public RelationshipToRDFConverter(NeoStores neoStores, Neo4jToRDFConverter neo4j
}

private void init() {
this.deployedRelationshiptypes = new UnifiedSet<>(neo4jToRDFConverter.getIndexedSchema().getRelationshipTypeIDToStr().size());
this.deployedRelationshipTypes = new UnifiedSet<>(neo4jToRDFConverter.getIndexedSchema().getRelationshipTypeIDToStr().size());
this.datatypePropertyKeys = new UnifiedSet<>(neo4jToRDFConverter.getIndexedSchema().getPropertyKeyIDToStr().size());
this.objectPropertyKeys = new UnifiedSet<>(neo4jToRDFConverter.getIndexedSchema().getPropertyKeyIDToStr().size());

Expand All @@ -55,14 +55,14 @@ protected void process(long relationshipID,
long targetID,
long typeID,
boolean statementHasAnnotations) {
deployedRelationshiptypes.add(relationshipID);
deployedRelationshipTypes.add(relationshipID);
Statement statement = valueFactory.createStatement(
neo4jToRDFMapper.nodeIDToResource(sourceID),
neo4jToRDFMapper.relationshipTypeIDToIRI(typeID),
neo4jToRDFMapper.nodeIDToResource(targetID),
neo4jToRDFMapper.relationshipIDToResource(relationshipID)
);
if (statementHasAnnotations) {
if (!config.isReifyOnlyStatementsWithAnnotations() || statementHasAnnotations) {
neo4jToRDFConverter.processStatement(statement);
neo4jToRDFMapper.statementToReificationTriples(statement, neo4jToRDFConverter::processStatement);
} else {
Expand Down Expand Up @@ -113,8 +113,8 @@ public Map<Long, Roaring64Bitmap> getRelationshipIDToInstanceSet() {
return relationshipIDToInstanceSet;
}

public Set<Long> getDeployedRelationshiptypes() {
return deployedRelationshiptypes;
public Set<Long> getDeployedRelationshipTypes() {
return deployedRelationshipTypes;
}

public Set<Long> getDatatypePropertyKeys() {
Expand Down
Loading

0 comments on commit 3652548

Please sign in to comment.