Skip to content

Commit

Permalink
Merge pull request #6 from dice-group/develop
Browse files Browse the repository at this point in the history
2.0.1
  • Loading branch information
Lixi authored May 14, 2021
2 parents ddcfbd9 + 83eb09f commit a4a6ced
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 36 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -38,8 +40,9 @@ 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
uses: actions/create-release@v1
Expand All @@ -59,3 +62,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 }}
20 changes: 0 additions & 20 deletions .github/workflows/package.yml

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/Getting-Started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.dice_group</groupId>
<artifactId>LPBenchGen</artifactId>
<artifactId>lpbenchgen</artifactId>
<version>${major.minor.version}.${build.version}</version>
<licenses>
<license>
Expand All @@ -29,7 +29,7 @@
<major.minor.version>${major.version}.${minor.version}</major.minor.version>
<major.version>2</major.version>
<minor.version>0</minor.version>
<build.version>0</build.version>
<build.version>1</build.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<log4j.version>2.13.3</log4j.version>
Expand Down Expand Up @@ -201,7 +201,7 @@
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/dice-group/LPBenchGen</url>
<url>https://maven.pkg.github.com/dice-group/lpbenchgen</url>
</repository>
</distributionManagement>

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -72,6 +73,7 @@ public OWLTBoxPositiveCreator(Configuration conf, IndividualRetriever retriever,
seed=conf.getSeed();
negationMutationRatio=conf.getNegationMutationRatio();
inferDirectSuperClasses=conf.getInferDirectSuperClasses();
negationMutationRandom = new Random(seed);

}

Expand All @@ -86,7 +88,6 @@ public List<String> getAllowedTypes() {

@Override
public Collection<PosNegExample> createDistinctConcepts(int noOfConcepts){
negationMutationRandom = new Random(seed);
Set<PosNegExample> ret = new HashSet<>();
int toSmallCount=0;
int noResults=0;
Expand Down Expand Up @@ -143,7 +144,11 @@ protected Double getConceptLength(OWLClassExpression concept) {
}


private Collection<OWLClassExpression> createConcepts(){
/**
* Creates a list of class expressions
* @return a list of class expressions
*/
public Collection<OWLClassExpression> createConcepts(){
List<OWLClassExpression> concepts = new ArrayList<>();
List<String> allowedTypes = new ArrayList<>(this.allowedTypes);
for(String type: allowedTypes){
Expand Down Expand Up @@ -183,37 +188,41 @@ private Set<OWLAxiom> getAxiomsForClass(OWLClass owlClass) {
}


private Collection<OWLClassExpression> 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<OWLClassExpression> createConceptsFromClass(OWLClass owlClass){
Collection<OWLClassExpression> 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<OWLClassExpression> ret) {
private void createConceptFromExpression(OWLClass start, OWLObjectPropertyRangeAxiom ax, Collection<OWLClassExpression> 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);
Expand Down Expand Up @@ -278,7 +287,6 @@ private Collection<OWLClassExpression> createConceptFromExpression(OWLClassExpre
}



private Collection<OWLObjectPropertyExpression> getRangePropertiesForClass(OWLClass owlClass) {
Collection<OWLObjectPropertyExpression> ret = new ArrayList<>();
getAxiomsForClass(owlClass).forEach(axiom -> {
Expand Down

0 comments on commit a4a6ced

Please sign in to comment.