Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Alignment API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
moex
Alignment API
Commits
a9d0e4de
Commit
a9d0e4de
authored
13 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- developed more systematic and elegant generator
parent
22066fb8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fr/inrialpes/exmo/align/gen/DiscriminantGenerator.java
+29
-147
29 additions, 147 deletions
src/fr/inrialpes/exmo/align/gen/DiscriminantGenerator.java
with
29 additions
and
147 deletions
src/fr/inrialpes/exmo/align/gen/DiscriminantGenerator.java
+
29
−
147
View file @
a9d0e4de
...
...
@@ -20,9 +20,9 @@
*/
/*
* Generates
the OAEI Benchmark dataset from an ontology
*
It can generate it in a continuous way (each test build on top of a previous one
)
*
or generate tests independently.
* Generates
a "discriminant" set of tests by systematically covering the
*
space at a particular resolution (STEP
)
*
This only applies to three different dimensions but could be parameterized
*/
package
fr.inrialpes.exmo.align.gen
;
...
...
@@ -39,159 +39,41 @@ public class DiscriminantGenerator extends TestSet {
secondOntoFile
=
params
.
getProperty
(
"outdir"
)+
"/000/onto.rdf"
;
// Test configuration parameters
int
maximum
=
5
;
float
incr
=
0.2f
;
String
mod
=
params
.
getProperty
(
"modality"
);
// "mult"
boolean
multModality
=
(
mod
!=
null
&&
mod
.
startsWith
(
"mult"
));
String
hard
=
params
.
getProperty
(
"increment"
);
int
STEP
=
5
;
String
stepval
=
params
.
getProperty
(
"step"
);
try
{
if
(
hard
!=
null
&&
!
hard
.
equals
(
""
)
)
incr
=
Float
.
parseFloat
(
hard
);
if
(
stepval
!=
null
&&
!
stepval
.
equals
(
""
)
)
STEP
=
Integer
.
parseInt
(
stepval
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
// continue with the default
}
String
max
=
params
.
getProperty
(
"maximum"
);
if
(
max
!=
null
)
maximum
=
Integer
.
parseInt
(
max
);
if
(
debug
)
System
.
err
.
println
(
" Mod: "
+
mod
+
" / Incr: "
+
incr
+
" / Max: "
+
maximum
);
final
float
INCR
=
1.0f
/(
STEP
-
1
);
if
(
debug
)
System
.
err
.
println
(
" STEP: "
+
STEP
+
" / INCR: "
+
INCR
);
/* Test 000 Generate the initial situation */
root
=
initTests
(
"000"
);
float
i1
=
0.0f
;
/* Iterator for gradual change
for ( int i = 0; i1 < 1.00f && i < maximum ; i++ ) { //
} */
/* Iterator for gradual change
for ( int i = 0; i1 < 1.00f && i < maximum ; i++ ) { //
if ( i > 0 ) PREVTEST = "201"+SUFFIX; // The previous suffix
if ( !multModality ) i1 += incr; // traditional
else i1 += (1. - i1) * incr; // hardened
//if ( debug ) System.err.println( " ******************************************************** "+i+": i1 = "+i1 );
if ( i1 < 1.0f ) {
SUFFIX = "-"+(i+1)*2; //((Float)i1).toString().substring(2, 3); // 2 4 6 8
} else {
SUFFIX = "";
for
(
int
i
=
0
;
i
<
STEP
;
i
++
)
{
String
label1
=
i
+
"00"
;
if
(
i
!=
0
)
{
addTestChild
(
"000"
,
label1
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
""
+
i
*
INCR
)
);
}
} */
final
String
FIRST1
=
"0.25f"
;
final
String
HALF
=
"0.5f"
;
final
String
MORE3
=
"0.75f"
;
// Then FULL
// Degradation is 4* .25
/* 004-x *** no names */
addTestChild
(
"000"
,
"001"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
FIRST1
,
ParametersIds
.
RENAME_PROPERTIES
,
FIRST1
)
);
addTestChild
(
"000"
,
"002"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
HALF
,
ParametersIds
.
RENAME_PROPERTIES
,
HALF
)
);
addTestChild
(
"000"
,
"003"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
MORE3
,
ParametersIds
.
RENAME_PROPERTIES
,
MORE3
)
);
addTestChild
(
"000"
,
"004"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
FULL
,
ParametersIds
.
RENAME_PROPERTIES
,
FULL
)
);
/* 044 *** no names + no comments */
addTestChild
(
"004"
,
"014"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
FIRST1
)
);
addTestChild
(
"004"
,
"024"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
HALF
)
);
addTestChild
(
"004"
,
"034"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
MORE3
)
);
addTestChild
(
"004"
,
"044"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
FULL
)
);
/* 040 *** no comments */
addTestChild
(
"000"
,
"010"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
FIRST1
)
);
addTestChild
(
"000"
,
"020"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
HALF
)
);
addTestChild
(
"000"
,
"030"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
MORE3
)
);
addTestChild
(
"000"
,
"040"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
FULL
)
);
/* 044 *** no comments */
addTestChild
(
"040"
,
"041"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
FIRST1
,
ParametersIds
.
RENAME_PROPERTIES
,
FIRST1
)
);
addTestChild
(
"040"
,
"042"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
HALF
,
ParametersIds
.
RENAME_PROPERTIES
,
HALF
)
);
addTestChild
(
"040"
,
"043"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
MORE3
,
ParametersIds
.
RENAME_PROPERTIES
,
MORE3
)
);
/* 440 *** no comments */
addTestChild
(
"040"
,
"140"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
FIRST1
)
);
addTestChild
(
"040"
,
"240"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
HALF
)
);
addTestChild
(
"040"
,
"340"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
MORE3
)
);
/* 400 *** no property */
addTestChild
(
"000"
,
"100"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
FIRST1
)
);
addTestChild
(
"000"
,
"200"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
HALF
)
);
addTestChild
(
"000"
,
"300"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
MORE3
)
);
addTestChild
(
"000"
,
"400"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
FULL
)
);
/* 270 *** no property + no instance */
addTestChild
(
"004"
,
"104"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
FIRST1
)
);
addTestChild
(
"004"
,
"204"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
HALF
)
);
addTestChild
(
"004"
,
"304"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
MORE3
)
);
addTestChild
(
"004"
,
"404"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
FULL
)
);
addTestChild
(
"400"
,
"401"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
FIRST1
,
ParametersIds
.
RENAME_PROPERTIES
,
FIRST1
)
);
addTestChild
(
"400"
,
"402"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
HALF
,
ParametersIds
.
RENAME_PROPERTIES
,
HALF
)
);
addTestChild
(
"400"
,
"403"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
MORE3
,
ParametersIds
.
RENAME_PROPERTIES
,
MORE3
)
);
/* 444 *** no property + expand */
addTestChild
(
"404"
,
"414"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
FIRST1
)
);
addTestChild
(
"404"
,
"424"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
HALF
)
);
addTestChild
(
"404"
,
"434"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
MORE3
)
);
/* 280 *** no property + expand */
addTestChild
(
"400"
,
"410"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
FIRST1
)
);
addTestChild
(
"400"
,
"420"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
HALF
)
);
addTestChild
(
"400"
,
"430"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
MORE3
)
);
addTestChild
(
"400"
,
"440"
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
FULL
)
);
addTestChild
(
"440"
,
"441"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
FIRST1
,
ParametersIds
.
RENAME_PROPERTIES
,
FIRST1
)
);
addTestChild
(
"440"
,
"442"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
HALF
,
ParametersIds
.
RENAME_PROPERTIES
,
HALF
)
);
addTestChild
(
"440"
,
"443"
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
MORE3
,
ParametersIds
.
RENAME_PROPERTIES
,
MORE3
)
);
/* 250-x *** no names + no comments + no property */
addTestChild
(
"044"
,
"144"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
FIRST1
)
);
addTestChild
(
"044"
,
"244"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
HALF
)
);
addTestChild
(
"044"
,
"344"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
MORE3
)
);
addTestChild
(
"044"
,
"444"
,
newProperties
(
ParametersIds
.
REMOVE_PROPERTIES
,
FULL
)
);
for
(
int
j
=
0
;
j
<
STEP
;
j
++
)
{
String
label2
=
""
+
i
+
j
+
"0"
;
if
(
i
!=
0
||
j
!=
0
)
{
addTestChild
(
label1
,
label2
,
newProperties
(
ParametersIds
.
REMOVE_COMMENTS
,
""
+
j
*
INCR
)
);
}
for
(
int
k
=
0
;
k
<
STEP
;
k
++
)
{
String
label3
=
""
+
i
+
j
+
k
;
if
(
i
!=
0
||
j
!=
0
||
k
!=
0
)
{
addTestChild
(
label2
,
""
+
i
+
j
+
k
,
newProperties
(
ParametersIds
.
RENAME_CLASSES
,
""
+
k
*
INCR
,
ParametersIds
.
RENAME_PROPERTIES
,
""
+
k
*
INCR
)
);
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment