From 4ac73b9d315a923ef31735782a83ff3bbb393a20 Mon Sep 17 00:00:00 2001 From: TortugaAttack Date: Mon, 10 May 2021 16:26:59 +0200 Subject: [PATCH 1/2] correcting CI --- .github/workflows/ci.yml | 5 +++++ .github/workflows/package.yml | 20 -------------------- pom.xml | 4 ++-- 3 files changed, 7 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/package.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdddbe9..e346415 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,7 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./site destination_dir: ./ + - run: mvn package -Dmaven.test.skip=true - name: Create Release id: create_release uses: actions/create-release@v1 @@ -59,3 +60,7 @@ jobs: asset_path: ./target/${{ env.RELEASE_ARTIFACTID }}-${{ env.RELEASE_VERSION }}-shaded.jar asset_name: lpbenchgen-${{ env.RELEASE_VERSION }}.jar asset_content_type: application/zip + - name: Publish package + run: mvn --batch-mode deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml deleted file mode 100644 index 49f246c..0000000 --- a/.github/workflows/package.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Publish package to GitHub Packages -on: - release: - types: [created] -jobs: - publish: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Publish package - run: mvn --batch-mode deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index ef2f164..de27f9a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 org.dice_group - LPBenchGen + lpbenchgen ${major.minor.version}.${build.version} @@ -201,7 +201,7 @@ github GitHub Packages - https://maven.pkg.github.com/dice-group/LPBenchGen + https://maven.pkg.github.com/dice-group/lpbenchgen From 83eb09f523d84a67d438c664733b4c3b55e60846 Mon Sep 17 00:00:00 2001 From: TortugaAttack Date: Fri, 14 May 2021 11:02:13 +0200 Subject: [PATCH 2/2] fixing --- .github/workflows/ci.yml | 6 ++-- CHANGELOG.md | 12 ++++++++ docs/Getting-Started/index.md | 2 +- pom.xml | 2 +- .../dl/creator/OWLTBoxPositiveCreator.java | 28 ++++++++++++------- 5 files changed, 36 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e346415..c105b60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,8 @@ jobs: run: mvn help:evaluate -Dexpression=major.minor.version -q -DforceStdout > version.log - shell: bash run: mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout > artifactid.log + - name: Set env version + run: echo "MM_VERSION=$(cat version.log)" >> $GITHUB_ENV - name: Set env version run: echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV - name: Set env name @@ -38,8 +40,8 @@ jobs: uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./site - destination_dir: ./ + publish_dir: ./site/${{ env.MM_VERSION }} + destination_dir: ./${{ env.MM_VERSION }} - run: mvn package -Dmaven.test.skip=true - name: Create Release id: create_release diff --git a/CHANGELOG.md b/CHANGELOG.md index fd8207b..a230bac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# CHANGELOG version 2.0.1 + +## General Changes + +## Added Features + +## Removed Features + +## Issues fixed + +* Concept creator threw error if domain/range of property is complex expression fixed. + # CHANGELOG version 2.0.0 ## General Changes diff --git a/docs/Getting-Started/index.md b/docs/Getting-Started/index.md index 5364e93..9151f4e 100644 --- a/docs/Getting-Started/index.md +++ b/docs/Getting-Started/index.md @@ -15,6 +15,6 @@ sudo apt-get install java To download LPBenchGen get the latest release [here](https://github.com/dice-group/LPBenchGen/releases/latest). ```bash -wget https://github.com/dice-group/LPBenchGen/releases/{{ release_version }}/lpbenchgen-{{ version }}.jar +wget https://github.com/dice-group/LPBenchGen/releases/download/v{{ release_version }}/lpbenchgen-{{ release_version }}.jar ``` diff --git a/pom.xml b/pom.xml index de27f9a..d7af636 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ ${major.version}.${minor.version} 2 0 - 0 + 1 11 11 2.13.3 diff --git a/src/main/java/org/dice_group/lpbenchgen/dl/creator/OWLTBoxPositiveCreator.java b/src/main/java/org/dice_group/lpbenchgen/dl/creator/OWLTBoxPositiveCreator.java index 6429408..b8325a3 100644 --- a/src/main/java/org/dice_group/lpbenchgen/dl/creator/OWLTBoxPositiveCreator.java +++ b/src/main/java/org/dice_group/lpbenchgen/dl/creator/OWLTBoxPositiveCreator.java @@ -1,6 +1,7 @@ package org.dice_group.lpbenchgen.dl.creator; import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import org.dice_group.lpbenchgen.config.Configuration; import org.dice_group.lpbenchgen.config.PosNegExample; import org.dice_group.lpbenchgen.dl.ConceptLengthCalculator; @@ -72,6 +73,7 @@ public OWLTBoxPositiveCreator(Configuration conf, IndividualRetriever retriever, seed=conf.getSeed(); negationMutationRatio=conf.getNegationMutationRatio(); inferDirectSuperClasses=conf.getInferDirectSuperClasses(); + negationMutationRandom = new Random(seed); } @@ -86,7 +88,6 @@ public List getAllowedTypes() { @Override public Collection createDistinctConcepts(int noOfConcepts){ - negationMutationRandom = new Random(seed); Set ret = new HashSet<>(); int toSmallCount=0; int noResults=0; @@ -143,7 +144,11 @@ protected Double getConceptLength(OWLClassExpression concept) { } - private Collection createConcepts(){ + /** + * Creates a list of class expressions + * @return a list of class expressions + */ + public Collection createConcepts(){ List concepts = new ArrayList<>(); List allowedTypes = new ArrayList<>(this.allowedTypes); for(String type: allowedTypes){ @@ -183,37 +188,41 @@ private Set getAxiomsForClass(OWLClass owlClass) { } - private Collection createConceptsFromClass(OWLClass owlClass){ + /** + * Creates a list of class expressions starting at the owlClass + * @param owlClass start point of the class expressions + * @return list of class expressions + */ + protected Collection createConceptsFromClass(OWLClass owlClass){ Collection ret = new ArrayList<>(); ret.add(owlClass); addNegationMutation(ret, owlClass); createConceptFromExpression(owlClass, ret); getAxiomsForClass(owlClass).forEach(axiom ->{ if(axiom instanceof OWLObjectPropertyRangeAxiom){ - createConceptFromExpression(((OWLObjectPropertyRangeAxiom) axiom), ret); + createConceptFromExpression(owlClass, ((OWLObjectPropertyRangeAxiom) axiom), ret); } }); return ret; } - private void createConceptFromExpression(OWLObjectPropertyRangeAxiom ax, Collection ret) { + private void createConceptFromExpression(OWLClass start, OWLObjectPropertyRangeAxiom ax, Collection ret) { if(1 <= maxDepth) { OWLObjectPropertyExpression prop = ax.getProperty(); - OWLClassExpression owlClass2 = ax.getRange(); - OWLClassExpression propExpr = new OWLObjectSomeValuesFromImpl(prop, owlClass2); + OWLClassExpression propExpr = new OWLObjectSomeValuesFromImpl(prop, start); if (getConceptLength(propExpr) <= maxConceptLength) { ret.add(propExpr); addNegationMutation(ret, propExpr); - for (OWLClassExpression expr : createConceptFromExpression(owlClass2, getRangePropertiesForClass((OWLClass) owlClass2), 1 + 1)) { + for (OWLClassExpression expr : createConceptFromExpression(start, getRangePropertiesForClass(start), 1 + 1)) { OWLClassExpression pexpr = new OWLObjectSomeValuesFromImpl(prop, expr); if (getConceptLength(pexpr) <= maxConceptLength) { addNegationMutation(ret, pexpr); ret.add(pexpr); } } - for (OWLClass inferredClass : res.getSubClasses(owlClass2).getFlattened()) { + for (OWLClass inferredClass : res.getSubClasses(start).getFlattened()) { if (allowedTypes.contains(inferredClass.getIRI().toString())) { OWLClassExpression negationPropExpr = new OWLObjectSomeValuesFromImpl(prop, inferredClass); ret.add(negationPropExpr); @@ -278,7 +287,6 @@ private Collection createConceptFromExpression(OWLClassExpre } - private Collection getRangePropertiesForClass(OWLClass owlClass) { Collection ret = new ArrayList<>(); getAxiomsForClass(owlClass).forEach(axiom -> {