Skip to content

Commit a4a6ced

Browse files
author
Lixi
authored
Merge pull request #6 from dice-group/develop
2.0.1
2 parents ddcfbd9 + 83eb09f commit a4a6ced

File tree

6 files changed

+43
-36
lines changed

6 files changed

+43
-36
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
run: mvn help:evaluate -Dexpression=major.minor.version -q -DforceStdout > version.log
2121
- shell: bash
2222
run: mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout > artifactid.log
23+
- name: Set env version
24+
run: echo "MM_VERSION=$(cat version.log)" >> $GITHUB_ENV
2325
- name: Set env version
2426
run: echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
2527
- name: Set env name
@@ -38,8 +40,9 @@ jobs:
3840
uses: peaceiris/actions-gh-pages@v3
3941
with:
4042
github_token: ${{ secrets.GITHUB_TOKEN }}
41-
publish_dir: ./site
42-
destination_dir: ./
43+
publish_dir: ./site/${{ env.MM_VERSION }}
44+
destination_dir: ./${{ env.MM_VERSION }}
45+
- run: mvn package -Dmaven.test.skip=true
4346
- name: Create Release
4447
id: create_release
4548
uses: actions/create-release@v1
@@ -59,3 +62,7 @@ jobs:
5962
asset_path: ./target/${{ env.RELEASE_ARTIFACTID }}-${{ env.RELEASE_VERSION }}-shaded.jar
6063
asset_name: lpbenchgen-${{ env.RELEASE_VERSION }}.jar
6164
asset_content_type: application/zip
65+
- name: Publish package
66+
run: mvn --batch-mode deploy
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/package.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# CHANGELOG version 2.0.1
2+
3+
## General Changes
4+
5+
## Added Features
6+
7+
## Removed Features
8+
9+
## Issues fixed
10+
11+
* Concept creator threw error if domain/range of property is complex expression fixed.
12+
113
# CHANGELOG version 2.0.0
214

315
## General Changes

docs/Getting-Started/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ sudo apt-get install java
1515
To download LPBenchGen get the latest release [here](https://github.com/dice-group/LPBenchGen/releases/latest).
1616

1717
```bash
18-
wget https://github.com/dice-group/LPBenchGen/releases/{{ release_version }}/lpbenchgen-{{ version }}.jar
18+
wget https://github.com/dice-group/LPBenchGen/releases/download/v{{ release_version }}/lpbenchgen-{{ release_version }}.jar
1919
```
2020

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77

88
<groupId>org.dice_group</groupId>
9-
<artifactId>LPBenchGen</artifactId>
9+
<artifactId>lpbenchgen</artifactId>
1010
<version>${major.minor.version}.${build.version}</version>
1111
<licenses>
1212
<license>
@@ -29,7 +29,7 @@
2929
<major.minor.version>${major.version}.${minor.version}</major.minor.version>
3030
<major.version>2</major.version>
3131
<minor.version>0</minor.version>
32-
<build.version>0</build.version>
32+
<build.version>1</build.version>
3333
<maven.compiler.source>11</maven.compiler.source>
3434
<maven.compiler.target>11</maven.compiler.target>
3535
<log4j.version>2.13.3</log4j.version>
@@ -201,7 +201,7 @@
201201
<repository>
202202
<id>github</id>
203203
<name>GitHub Packages</name>
204-
<url>https://maven.pkg.github.com/dice-group/LPBenchGen</url>
204+
<url>https://maven.pkg.github.com/dice-group/lpbenchgen</url>
205205
</repository>
206206
</distributionManagement>
207207

src/main/java/org/dice_group/lpbenchgen/dl/creator/OWLTBoxPositiveCreator.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.dice_group.lpbenchgen.dl.creator;
22

33
import com.google.common.collect.Lists;
4+
import com.google.common.collect.Sets;
45
import org.dice_group.lpbenchgen.config.Configuration;
56
import org.dice_group.lpbenchgen.config.PosNegExample;
67
import org.dice_group.lpbenchgen.dl.ConceptLengthCalculator;
@@ -72,6 +73,7 @@ public OWLTBoxPositiveCreator(Configuration conf, IndividualRetriever retriever,
7273
seed=conf.getSeed();
7374
negationMutationRatio=conf.getNegationMutationRatio();
7475
inferDirectSuperClasses=conf.getInferDirectSuperClasses();
76+
negationMutationRandom = new Random(seed);
7577

7678
}
7779

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

8789
@Override
8890
public Collection<PosNegExample> createDistinctConcepts(int noOfConcepts){
89-
negationMutationRandom = new Random(seed);
9091
Set<PosNegExample> ret = new HashSet<>();
9192
int toSmallCount=0;
9293
int noResults=0;
@@ -143,7 +144,11 @@ protected Double getConceptLength(OWLClassExpression concept) {
143144
}
144145

145146

146-
private Collection<OWLClassExpression> createConcepts(){
147+
/**
148+
* Creates a list of class expressions
149+
* @return a list of class expressions
150+
*/
151+
public Collection<OWLClassExpression> createConcepts(){
147152
List<OWLClassExpression> concepts = new ArrayList<>();
148153
List<String> allowedTypes = new ArrayList<>(this.allowedTypes);
149154
for(String type: allowedTypes){
@@ -183,37 +188,41 @@ private Set<OWLAxiom> getAxiomsForClass(OWLClass owlClass) {
183188
}
184189

185190

186-
private Collection<OWLClassExpression> createConceptsFromClass(OWLClass owlClass){
191+
/**
192+
* Creates a list of class expressions starting at the owlClass
193+
* @param owlClass start point of the class expressions
194+
* @return list of class expressions
195+
*/
196+
protected Collection<OWLClassExpression> createConceptsFromClass(OWLClass owlClass){
187197
Collection<OWLClassExpression> ret = new ArrayList<>();
188198
ret.add(owlClass);
189199
addNegationMutation(ret, owlClass);
190200
createConceptFromExpression(owlClass, ret);
191201
getAxiomsForClass(owlClass).forEach(axiom ->{
192202
if(axiom instanceof OWLObjectPropertyRangeAxiom){
193-
createConceptFromExpression(((OWLObjectPropertyRangeAxiom) axiom), ret);
203+
createConceptFromExpression(owlClass, ((OWLObjectPropertyRangeAxiom) axiom), ret);
194204
}
195205

196206
});
197207
return ret;
198208
}
199209

200-
private void createConceptFromExpression(OWLObjectPropertyRangeAxiom ax, Collection<OWLClassExpression> ret) {
210+
private void createConceptFromExpression(OWLClass start, OWLObjectPropertyRangeAxiom ax, Collection<OWLClassExpression> ret) {
201211
if(1 <= maxDepth) {
202212
OWLObjectPropertyExpression prop = ax.getProperty();
203-
OWLClassExpression owlClass2 = ax.getRange();
204-
OWLClassExpression propExpr = new OWLObjectSomeValuesFromImpl(prop, owlClass2);
213+
OWLClassExpression propExpr = new OWLObjectSomeValuesFromImpl(prop, start);
205214
if (getConceptLength(propExpr) <= maxConceptLength) {
206215
ret.add(propExpr);
207216

208217
addNegationMutation(ret, propExpr);
209-
for (OWLClassExpression expr : createConceptFromExpression(owlClass2, getRangePropertiesForClass((OWLClass) owlClass2), 1 + 1)) {
218+
for (OWLClassExpression expr : createConceptFromExpression(start, getRangePropertiesForClass(start), 1 + 1)) {
210219
OWLClassExpression pexpr = new OWLObjectSomeValuesFromImpl(prop, expr);
211220
if (getConceptLength(pexpr) <= maxConceptLength) {
212221
addNegationMutation(ret, pexpr);
213222
ret.add(pexpr);
214223
}
215224
}
216-
for (OWLClass inferredClass : res.getSubClasses(owlClass2).getFlattened()) {
225+
for (OWLClass inferredClass : res.getSubClasses(start).getFlattened()) {
217226
if (allowedTypes.contains(inferredClass.getIRI().toString())) {
218227
OWLClassExpression negationPropExpr = new OWLObjectSomeValuesFromImpl(prop, inferredClass);
219228
ret.add(negationPropExpr);
@@ -278,7 +287,6 @@ private Collection<OWLClassExpression> createConceptFromExpression(OWLClassExpre
278287
}
279288

280289

281-
282290
private Collection<OWLObjectPropertyExpression> getRangePropertiesForClass(OWLClass owlClass) {
283291
Collection<OWLObjectPropertyExpression> ret = new ArrayList<>();
284292
getAxiomsForClass(owlClass).forEach(axiom -> {

0 commit comments

Comments
 (0)