Rupert Westenthaler created STANBOL-824:
-------------------------------------------

             Summary: Stanbol Namespace Prefix service
                 Key: STANBOL-824
                 URL: https://issues.apache.org/jira/browse/STANBOL-824
             Project: Stanbol
          Issue Type: New Feature
          Components: Commons
            Reporter: Rupert Westenthaler
            Assignee: Rupert Westenthaler


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

To ensure backwards compatibility there will be two implementations of the 
PrefixProviders based on the NamespaceEnums defined in the Enhancer and the 
Entityhub. Those services and the Namespaces will be marked as deprecated and 
removed in an future Stanbol release


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to