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
7961840a
Commit
7961840a
authored
15 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- Added this unique class for storing namespace name (inspired from OMWG)
parent
31f22787
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/impl/Namespace.java
+110
-0
110 additions, 0 deletions
src/fr/inrialpes/exmo/align/impl/Namespace.java
with
110 additions
and
0 deletions
src/fr/inrialpes/exmo/align/impl/Namespace.java
0 → 100644
+
110
−
0
View file @
7961840a
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Copyright (C) 2005 Digital Enterprise Research Insitute (DERI) Galway
* Sourceforge version 1.2 - 2008 - then NamespaceDefs.java
* Copyright (C) INRIA, 2008-2009
*
* 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
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package
fr.inrialpes.exmo.align.impl
;
import
java.util.HashMap
;
import
java.util.Map
;
// TODO: get shortcut by uri
// JE: for extendibility purposes, it would be useful that this class be something
// else than an enum class.
public
enum
Namespace
{
// JE: added align as shortcut
// JE: But latter suppressed because, "" may be used for default namespace
// JE2009: I one use print(DEF), then it is not needed...
//ALIGNMENT("http://knowledgeweb.semanticweb.org/heterogeneity/alignment", "align"),
ALIGNMENT
(
"http://knowledgeweb.semanticweb.org/heterogeneity/alignment"
,
"align"
,
true
),
// JE2009: is this never used??
//OMWG("http://ns.inria.org/edoal/0.9", "omwg", true),
EDOAL
(
"http://ns.inria.org/edoal/1.0/"
,
"edoal"
,
true
),
DUBLIN_CORE
(
"http://purl.org/dc/elements/1.1/"
,
"dc"
,
false
),
RDF_SCHEMA
(
"http://www.w3.org/2000/01/rdf-schema#"
,
"rdfs"
,
false
),
XSD
(
"http://www.w3.org/2001/XMLSchema#"
,
"xsd"
,
false
),
RDF
(
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
,
"rdf"
,
false
),
WSML_CORE
(
"http://www.wsmo.org/wsml/wsml-syntax/wsml-core"
,
"wsml"
,
true
),
WSML_FLIGHT
(
"http://www.wsmo.org/wsml/wsml-syntax/wsml-flight"
,
"wsml"
,
true
),
WSML_RULE
(
"http://www.wsmo.org/wsml/wsml-syntax/wsml-rule"
,
"wsml"
,
true
),
WSML_DL
(
"http://www.wsmo.org/wsml/wsml-syntax/wsml-dl"
,
"wsml"
,
true
),
WSML_FULL
(
"http://www.wsmo.org/wsml/wsml-syntax/wsml-full"
,
"wsml"
,
true
);
public
final
String
uri
;
public
final
String
shortCut
;
/**
* records if a sharp must be concatenated to the namespace
*/
private
final
boolean
addSharp
;
private
String
prefix
;
private
static
final
Map
<
String
,
Namespace
>
register
=
new
HashMap
<
String
,
Namespace
>();
Namespace
(
final
String
sUri
,
final
String
sShort
,
final
boolean
sharp
)
{
uri
=
sUri
;
shortCut
=
sShort
;
addSharp
=
sharp
;
if
(
addSharp
)
prefix
=
uri
+
"#"
;
else
prefix
=
uri
;
}
public
String
getUri
()
{
return
uri
;
}
public
String
getUriPrefix
()
{
return
prefix
;
}
public
String
getShortCut
()
{
return
shortCut
;
}
public
boolean
getSharp
()
{
return
addSharp
;
}
/**
* Determines a namespace instance depending on it's url.
*
* @param url
* the url of the namespace.
* @return the namespace instance, or null, if no mathing namespace could be
* found.
*/
public
static
Namespace
getNSByUri
(
final
String
url
)
{
Namespace
result
=
null
;
if
(
register
.
size
()
<=
0
)
{
for
(
Namespace
ns
:
Namespace
.
values
()
)
{
register
.
put
(
ns
.
getUri
(),
ns
);
if
(
ns
.
getUri
().
equals
(
url
)
)
result
=
ns
;
}
}
else
{
result
=
register
.
get
(
url
);
}
return
result
;
}
}
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