# Path: src/franz/openrdf/model/value.py
# class URI(Resource):
#     """
#     Lightweight implementation of the class 'URI'.
#     """
#     __slots__ = ('_uri', '_is_canonical')
# 
#     _instances = weakref.WeakValueDictionary()
# 
#     def __new__(cls, uri=None, namespace=None, localname=None, canonical=True):
#         if isinstance(uri, URI):
#             if not canonical or uri._is_canonical:
#                 return uri
#             uri = uri.uri
#         elif uri is None and namespace is not None:
#             uri = namespace + (localname or '')
# 
#         if uri is None:
#             raise ValueError('Either URI or namespace is required.')
# 
#         if canonical:
#             result = URI._instances.get(uri)
#             if result is not None:
#                 return result
# 
#         result = super(URI, cls).__new__(cls)
#         if canonical:
#             URI._instances[uri] = result
#         return result
# 
#     def __init__(self, uri=None, namespace=None, localname=None, canonical=False):
#         if isinstance(uri, URI):
#             uri = uri.uri
# 
#         if uri is None and namespace is not None:
#             uri = namespace + (localname or '')
# 
#         if uri and uri[0] == '<' and uri[len(uri) - 1] == '>':
#             # be kind and trim the uri:
#             uri = uri[1:-1]
#         self._uri = uri
#         self._is_canonical = canonical
# 
#     def get_cmp_key(self):
#         return URI_CMP_KEY, self.uri
#     
#     def getURI(self):
#         """
#         Return the URI (string) for 'self'.  This method is typically
#         overloaded by subclasses, which may use lazy evaluation to
#         retrieve the string.
#         """
#         return self._uri
# 
#     uri = property(getURI)
#     
#     def getValue(self):
#         return self.getURI()
# 
#     value = property(getValue)
#     
#     def getLocalName(self):
#         pos = uris.getLocalNameIndex(self.getURI())
#         return self.uri[pos:]
#     
#     localname = property(getLocalName)
# 
#     def getNamespace(self):
#         pos = uris.getLocalNameIndex(self.getURI())
#         return self.uri[:pos]
# 
#     def split(self):
#         """
#         Split into a namespace + local name pair.
#         """
#         pos = uris.getLocalNameIndex(self.uri)
#         return self.uri[:pos], self.uri[pos:]
# 
#     namespace = property(getNamespace)
# 
#     def toNTriples(self):
#         """
#         Return an NTriples representation of a resource, in this case, wrap
#         it in angle brackets.
#         """
#         return strings.encode_ntriple_uri(self.uri)
# 
#     def to_json_ld_key(self):
#         """ Converts to a string to be used as a JSON-LD key. """
#         return self.uri
# 
#     def to_json_ld(self):
#         """ Converts to an object to be used as a JSON-LD value. """
#         return {"@id": self.uri}


from future.builtins import object
from past.builtins import unicode
from future.utils import iteritems
from ..model.value import URI
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable-msg=C0103

################################################################################
# Copyright (c) 2006-2017 Franz Inc.  
# All rights reserved. This program and the accompanying materials are
# made available under the terms of the MIT License which accompanies
# this distribution, and is available at http://opensource.org/licenses/MIT
################################################################################

from __future__ import absolute_import
from __future__ import unicode_literals



NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"

class RDF(object):
    """
    A 'static' class containing useful RDF URIs.
    """

    NAMESPACE = NS

# Path: src/franz/openrdf/model/value.py
# class URI(Resource):
#     """
#     Lightweight implementation of the class 'URI'.
#     """
#     __slots__ = ('_uri', '_is_canonical')
# 
#     _instances = weakref.WeakValueDictionary()
# 
#     def __new__(cls, uri=None, namespace=None, localname=None, canonical=True):
#         if isinstance(uri, URI):
#             if not canonical or uri._is_canonical:
#                 return uri
#             uri = uri.uri
#         elif uri is None and namespace is not None:
#             uri = namespace + (localname or '')
# 
#         if uri is None:
#             raise ValueError('Either URI or namespace is required.')
# 
#         if canonical:
#             result = URI._instances.get(uri)
#             if result is not None:
#                 return result
# 
#         result = super(URI, cls).__new__(cls)
#         if canonical:
#             URI._instances[uri] = result
#         return result
# 
#     def __init__(self, uri=None, namespace=None, localname=None, canonical=False):
#         if isinstance(uri, URI):
#             uri = uri.uri
# 
#         if uri is None and namespace is not None:
#             uri = namespace + (localname or '')
# 
#         if uri and uri[0] == '<' and uri[len(uri) - 1] == '>':
#             # be kind and trim the uri:
#             uri = uri[1:-1]
#         self._uri = uri
#         self._is_canonical = canonical
# 
#     def get_cmp_key(self):
#         return URI_CMP_KEY, self.uri
#     
#     def getURI(self):
#         """
#         Return the URI (string) for 'self'.  This method is typically
#         overloaded by subclasses, which may use lazy evaluation to
#         retrieve the string.
#         """
#         return self._uri
# 
#     uri = property(getURI)
#     
#     def getValue(self):
#         return self.getURI()
# 
#     value = property(getValue)
#     
#     def getLocalName(self):
#         pos = uris.getLocalNameIndex(self.getURI())
#         return self.uri[pos:]
#     
#     localname = property(getLocalName)
# 
#     def getNamespace(self):
#         pos = uris.getLocalNameIndex(self.getURI())
#         return self.uri[:pos]
# 
#     def split(self):
#         """
#         Split into a namespace + local name pair.
#         """
#         pos = uris.getLocalNameIndex(self.uri)
#         return self.uri[:pos], self.uri[pos:]
# 
#     namespace = property(getNamespace)
# 
#     def toNTriples(self):
#         """
#         Return an NTriples representation of a resource, in this case, wrap
#         it in angle brackets.
#         """
#         return strings.encode_ntriple_uri(self.uri)
# 
#     def to_json_ld_key(self):
#         """ Converts to a string to be used as a JSON-LD key. """
#         return self.uri
# 
#     def to_json_ld(self):
#         """ Converts to an object to be used as a JSON-LD value. """
#         return {"@id": self.uri}


# Path: src/franz/openrdf/vocabulary/rdf.py
from future.builtins import object
from past.builtins import unicode
from future.utils import iteritems
from ..model.value import URI

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable-msg=C0103

################################################################################
# Copyright (c) 2006-2017 Franz Inc.  
# All rights reserved. This program and the accompanying materials are
# made available under the terms of the MIT License which accompanies
# this distribution, and is available at http://opensource.org/licenses/MIT
################################################################################

from __future__ import absolute_import
from __future__ import unicode_literals



NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"

class RDF(object):
    """
    A 'static' class containing useful RDF URIs.
    """

    NAMESPACE = NS

    TYPE = URI(namespace=NS, localname="type")