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
316a2219
Commit
316a2219
authored
10 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- implemented match() on BasicOntologyNetwork
parent
4554eb5f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/fr/inrialpes/exmo/align/impl/BasicOntologyNetwork.java
+25
-8
25 additions, 8 deletions
src/fr/inrialpes/exmo/align/impl/BasicOntologyNetwork.java
src/fr/inrialpes/exmo/align/service/AServProtocolManager.java
+8
-13
8 additions, 13 deletions
...fr/inrialpes/exmo/align/service/AServProtocolManager.java
with
33 additions
and
21 deletions
src/fr/inrialpes/exmo/align/impl/BasicOntologyNetwork.java
+
25
−
8
View file @
316a2219
...
...
@@ -31,8 +31,10 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.HashSet
;
import
java.util.Hashtable
;
import
java.util.Properties
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.lang.reflect.Constructor
;
import
java.io.PrintWriter
;
import
java.io.InputStream
;
...
...
@@ -56,6 +58,7 @@ import fr.inrialpes.exmo.align.parser.AlignmentParser;
import
fr.inrialpes.exmo.align.impl.Namespace
;
import
org.semanticweb.owl.align.Alignment
;
import
org.semanticweb.owl.align.AlignmentProcess
;
import
org.semanticweb.owl.align.AlignmentException
;
import
org.semanticweb.owl.align.OntologyNetwork
;
...
...
@@ -236,7 +239,7 @@ public class BasicOntologyNetwork implements OntologyNetwork {
* public void match( Class<? extends AlignmentProcess> method, boolean reflexive ) throws AlignmentException {
}
*/
public
void
match
(
String
method
,
boolean
reflexive
,
boolean
symmetric
)
throws
AlignmentException
{
public
void
match
(
String
method
,
boolean
reflexive
,
boolean
symmetric
,
Properties
params
)
throws
AlignmentException
{
for
(
OntologyTriple
ot1
:
ontologies
.
values
()
)
{
for
(
OntologyTriple
ot2
:
ontologies
.
values
()
)
{
if
(
(
ot1
==
ot2
&&
reflexive
)
...
...
@@ -246,13 +249,27 @@ public class BasicOntologyNetwork implements OntologyNetwork {
for
(
Alignment
al
:
als
)
{
remAlignment
(
al
);
}
// Create the alignment process
//AlignmentProcess ap = ...
// Match
//ap.init( ot1.onto, ot2.onto );
//ap.align( init, (Properties)null );
// replace
//addAlignment( ap );
// Create the alignment process
AlignmentProcess
ap
=
null
;
try
{
// Create alignment object
Class
<?>
alignmentClass
=
Class
.
forName
(
method
);
Class
[]
cparams
=
{};
Constructor
alignmentConstructor
=
alignmentClass
.
getConstructor
(
cparams
);
Object
[]
mparams
=
{};
ap
=
(
AlignmentProcess
)
alignmentConstructor
.
newInstance
(
mparams
);
ap
.
init
(
ot1
.
onto
,
ot2
.
onto
);
}
catch
(
Exception
ex
)
{
logger
.
error
(
"Cannot create alignment {}"
,
method
);
throw
new
AlignmentException
(
"Cannot create alignment "
+
method
,
ex
);
}
// Compute alignment
long
time
=
System
.
currentTimeMillis
();
ap
.
align
(
init
,
params
);
// or params?
long
newTime
=
System
.
currentTimeMillis
();
ap
.
setExtension
(
Namespace
.
ALIGNMENT
.
uri
,
Annotations
.
TIME
,
Long
.
toString
(
newTime
-
time
)
);
// replace
addAlignment
(
ap
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/fr/inrialpes/exmo/align/service/AServProtocolManager.java
+
8
−
13
View file @
316a2219
...
...
@@ -1377,9 +1377,7 @@ public class AServProtocolManager implements Service {
}
public
List
<
Message
>
alignonet
(
Properties
params
)
{
public
List
<
Message
>
alignonet
(
Properties
params
)
{
List
<
Message
>
result
=
new
ArrayList
<>();
//not finished
//parameters: onID, method, reflexive, symmetric
...
...
@@ -1412,9 +1410,7 @@ public List<Message> alignonet( Properties params ) {
}
}
}
return
result
;
}
...
...
@@ -1431,22 +1427,21 @@ public List<Message> alignonet( Properties params ) {
if
(
params
.
getProperty
(
"symmetric"
)
!=
null
)
symmetric
=
true
;
try
{
noo
=
alignmentCache
.
getOntologyNetwork
(
id
);
}
catch
(
AlignmentException
e1
)
{
return
new
UnknownOntologyNetwork
(
params
,
newId
(),
serverId
,
id
);
}
noo
=
alignmentCache
.
getOntologyNetwork
(
id
);
}
catch
(
AlignmentException
e1
)
{
return
new
UnknownOntologyNetwork
(
params
,
newId
(),
serverId
,
id
);
}
logger
.
debug
(
" Before Network alignments results, id: {} total ontologies: {} total alignments: {}"
,
id
,
noo
.
getOntologies
().
size
(),
noo
.
getAlignments
().
size
());
try
{
((
BasicOntologyNetwork
)
noo
).
match
(
method
,
reflexive
,
symmetric
);
}
catch
(
AlignmentException
e
)
{
((
BasicOntologyNetwork
)
noo
).
match
(
method
,
reflexive
,
symmetric
,
params
);
}
catch
(
AlignmentException
e
)
{
return
new
ErrorMsg
(
params
,
newId
(),
serverId
,
"Network alignment error"
);
}
logger
.
debug
(
" Network alignments results, id: {} total ontologies: {} total alignments: {}"
,
id
,
noo
.
getOntologies
().
size
(),
noo
.
getAlignments
().
size
());
return
new
OntologyNetworkId
(
params
,
newId
(),
serverId
,
id
,
((
BasicOntologyNetwork
)
noo
).
getExtension
(
Namespace
.
ALIGNMENT
.
uri
,
Annotations
.
PRETTY
));
((
BasicOntologyNetwork
)
noo
).
getExtension
(
Namespace
.
ALIGNMENT
.
uri
,
Annotations
.
PRETTY
));
}
...
...
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