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
c1106ec4
"runtime/git@gitlab.inria.fr:solverstack/chameleon.git" did not exist on "137a3f52b43d50813405c33b031f1ac53aab0a5e"
Commit
c1106ec4
authored
11 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- added loadOntology actions
parent
3a79b03f
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/ontowrap/OntologyFactory.java
+36
-17
36 additions, 17 deletions
src/fr/inrialpes/exmo/ontowrap/OntologyFactory.java
with
36 additions
and
17 deletions
src/fr/inrialpes/exmo/ontowrap/OntologyFactory.java
+
36
−
17
View file @
c1106ec4
/*
* $Id$
*
* Copyright (C) INRIA, 2008, 2010-201
2
* Copyright (C) INRIA, 2008, 2010-201
3
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
...
...
@@ -28,9 +28,13 @@ import java.util.HashSet;
import
java.util.Map
;
import
java.util.HashMap
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.lang.reflect.InvocationTargetException
;
public
abstract
class
OntologyFactory
{
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
OntologyFactory
.
class
);
public
static
final
int
ANY
=
0
;
public
static
final
int
DIRECT
=
1
;
...
...
@@ -82,7 +86,7 @@ public abstract class OntologyFactory {
skos
.
add
(
"fr.inrialpes.exmo.ontowrap.skosapi.SKOSOntologyFactory"
);
}
catch
(
URISyntaxException
uriex
)
{
uriex
.
printStackTrace
();
// should never occur
logger
.
debug
(
"IGNORED (should never happen)"
,
uriex
);
}
}
return
factories
.
get
(
formalism
);
...
...
@@ -111,16 +115,16 @@ public abstract class OntologyFactory {
java
.
lang
.
reflect
.
Constructor
ofConstructor
=
ofClass
.
getConstructor
(
cparams
);
Object
[]
mparams
=
{};
of
=
(
OntologyFactory
)
ofConstructor
.
newInstance
(
mparams
);
}
catch
(
ClassNotFoundException
cnfex
)
{
cnfex
.
printStackTrace
(
);
// better raise errors
}
catch
(
NoSuchMethodException
nsmex
)
{
nsmex
.
printStackTrace
(
);
}
catch
(
InstantiationException
ieex
)
{
ieex
.
printStackTrace
(
);
}
catch
(
IllegalAccessException
iaex
)
{
iaex
.
printStackTrace
(
);
}
catch
(
InvocationTargetException
itex
)
{
itex
.
printStackTrace
(
);
}
catch
(
ClassNotFoundException
cnfex
)
{
logger
.
debug
(
"IGNORED Exception"
,
cnfex
);
// better raise errors
}
catch
(
NoSuchMethodException
nsmex
)
{
logger
.
debug
(
"IGNORED Exception"
,
nsmex
);
}
catch
(
InstantiationException
ieex
)
{
logger
.
debug
(
"IGNORED Exception"
,
ieex
);
}
catch
(
IllegalAccessException
iaex
)
{
logger
.
debug
(
"IGNORED Exception"
,
iaex
);
}
catch
(
InvocationTargetException
itex
)
{
logger
.
debug
(
"IGNORED Exception"
,
itex
);
}
instances
.
put
(
apiName
,
of
);
return
of
;
...
...
@@ -147,24 +151,39 @@ public abstract class OntologyFactory {
public
abstract
LoadedOntology
newOntology
(
Object
onto
,
boolean
onlyLocalEntities
)
throws
OntowrapException
;
public
LoadedOntology
newOntology
(
Object
onto
)
throws
OntowrapException
{
return
newOntology
(
onto
,
false
);
return
newOntology
(
onto
,
false
);
}
/**
* Load an ontology, cache enabled
* These methods should rather be in a LoadableOntologyFactory
*/
public
LoadedOntology
loadOntology
(
URI
uri
)
throws
OntowrapException
{
return
loadOntology
(
uri
,
true
);
// logger.trace( "loading URI: {}", uri );
return
loadOntology
(
uri
,
true
);
}
/*
* Loads and ontology which is not loaded yet
*/
public
LoadedOntology
loadOntology
(
Ontology
onto
)
throws
OntowrapException
{
// logger.trace( "loading Ontology: {}", onto );
try
{
// Try with URI
return
loadOntology
(
onto
.
getURI
()
);
}
catch
(
Exception
ex
)
{
try
{
// Try with file
return
loadOntology
(
onto
.
getFile
()
);
}
catch
(
Exception
ex2
)
{
throw
new
OntowrapException
(
"Cannot load ontology "
+
onto
);
}
}
}
/**
* Load an ontology, cache enabled
* These methods should rather be in a LoadableOntologyFactory
*/
public
abstract
LoadedOntology
loadOntology
(
URI
uri
,
boolean
onlyLocalEntities
)
throws
OntowrapException
;
public
abstract
LoadedOntology
loadOntology
(
URI
uri
,
boolean
onlyLocalEntities
)
throws
OntowrapException
;
/**
* Load an ontology, cache enabled if true, disabled otherwise
...
...
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