Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Currently Namespace Prefixes are defined statically in Enumerations.
AFAIK Stanbol has at two such enumerations
1. Enhancer services api
2. Entityhub services api
-
- Architecture
This issue will introduce a new Service infrastructure for dealing with namespace prefixes. It consists of two services: (1) NamespacePrefixService - user level service used to lookup namespace prefixes. It also allows to set prefix mappings (2) NamespacePrefixProvider - internally used to provide prefix to namespace mappings and
Here are the APIs
NamespacePrefixService
/** bidi mapping prefix - namespace */
getNamespace(String prefix) : String
getPrefix(String namespace) : String
/** A namespace may be mapped to multiple prefixes */
getPrefixes(String namespace) : List<String>
/** adds an new Prefix and returns the old mapping */
setPrefix(String prefix, String namespace) : String
/** converts prefix:localName to full URIs */
getFullName(String shortName) : String
/** converts URIs to prefix:localName */
getShortName(String uri) : String
NamespacePrefixProvider
getNamespace(String prefix) : String
getPrefix(String namespace) : String
/** A namespace may be mapped to multiple prefixes */
getPrefixes(String namespace) : List<String>
-
- Implementation
There will be a default implementation of the NamespacePrefixService provided by the module that defines the services. This implementation will register itself as OSGI service.
Custom added prefixes shall be stored in an java properties file located in the storage location of the bundle.
-
- prefix.cc NamespacePrefixProvider
In an additional module a NamespacePrefixProvider based on prefix.cc will be implemented. This will support the Stanbol Offline mode. This service will register itself with a negative service.ranking.
-
- Backward compatibility
The module will provide a NamespacePrefixProvider implementation that serves all namespaces currently defined by the NamespaceEnums of the Entityhub and the Enhancer. This provider will register itself with an high "service.ranking" (e.g. 1000000).
The namespace enumerations of the Enhancer and Stanbol will persist, but only contain namespaces referenced by the Ontologies of the according Components. All other namespaces and also utility methods will be deprecated in favor of the new service.
Attachments
Issue Links
- blocks
-
STANBOL-823 Refactor EntityLinkingEngine so that it does no longer depend on the Stanbol Entityhub Component
- Closed