-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 290d676
Showing
397 changed files
with
46,126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
10 | ||
|
||
dir | ||
0 | ||
http://knoesis-svn.cs.wright.edu/svn/pavan/pubsubhubbub/trunk/pshb-example/pubsubhubbub/hub/virtuoso_connect/SPARQLWrapper/SPARQLWrapper | ||
http://knoesis-svn.cs.wright.edu/svn/pavan | ||
add | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
svn:special svn:externals svn:needs-lock | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
8661c0b3-8f0a-4391-bfa0-cfeaea3dbe21 | ||
|
||
KeyInsensitiveDict.py | ||
file | ||
|
||
|
||
|
||
add | ||
|
||
SPARQLExceptions.py | ||
file | ||
|
||
|
||
|
||
add | ||
|
||
SPARQLUtils.py | ||
file | ||
|
||
|
||
|
||
add | ||
|
||
SmartWrapper.py | ||
file | ||
|
||
|
||
|
||
add | ||
|
||
Wrapper.py | ||
file | ||
|
||
|
||
|
||
add | ||
|
||
__init__.py | ||
file | ||
|
||
|
||
|
||
add | ||
|
||
jsonlayer.py | ||
file | ||
|
||
|
||
|
||
add | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
A simple implementation of a key-insensitive dictionary (implemented by using the pattern decorator). | ||
@authors: U{Ivan Herman<http://www.ivan-herman.net>}, U{Sergio Fernández<http://www.wikier.org>}, U{Carlos Tejo Alonso<http://www.dayures.net>} | ||
@organization: U{World Wide Web Consortium<http://www.w3.org>} and U{Foundation CTIC<http://www.fundacionctic.org/>}. | ||
@license: U{W3C® SOFTWARE NOTICE AND LICENSE<href="http://www.w3.org/Consortium/Legal/copyright-software">} | ||
""" | ||
|
||
class KeyInsensitiveDict: | ||
""" | ||
A simple implementation of a key-insensitive dictionary (implemented by using the pattern decorator). | ||
""" | ||
|
||
def __init__(self, d={}): | ||
self.__dict__["d"] = {} | ||
for k, v in d.items(): self[k] = v | ||
|
||
def __getattr__(self, attr): | ||
return getattr(self.__dict__["d"], attr) | ||
|
||
def __setattr__(self, attr, value): | ||
setattr(self.__dict__["d"], attr, value) | ||
|
||
def __setitem__(self, key, value): | ||
if (hasattr(key, "lower")): | ||
key = key.lower() | ||
self.__dict__["d"][key] = value | ||
|
||
def __getitem__(self, key): | ||
if (hasattr(key, "lower")): | ||
key = key.lower() | ||
return self.__dict__["d"][key] | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
SPARQL Wrapper exceptions | ||
@authors: U{Ivan Herman<http://www.ivan-herman.net>}, U{Sergio Fernández<http://www.wikier.org>}, U{Carlos Tejo Alonso<http://www.dayures.net>} | ||
@organization: U{World Wide Web Consortium<http://www.w3.org>} and U{Foundation CTIC<http://www.fundacionctic.org/>}. | ||
@license: U{W3C® SOFTWARE NOTICE AND LICENSE<href="http://www.w3.org/Consortium/Legal/copyright-software">} | ||
""" | ||
|
||
import exceptions | ||
|
||
class SPARQLWrapperException(exceptions.Exception): | ||
""" | ||
Base class for SPARQL Wrapper exceptions | ||
""" | ||
|
||
def __init__(self): | ||
Exception.__init__(self) | ||
|
||
def __str__(self): | ||
return "SPARQLWrapperException: an exception has occured" | ||
|
||
class QueryBadFormed(SPARQLWrapperException): | ||
""" | ||
Query Bad Formed exceptions | ||
""" | ||
|
||
def __init__(self): | ||
SPARQLWrapperException.__init__(self) | ||
|
||
def __str__(self): | ||
return "QueryBadFormed: a bad request has been sent to the endpoint, probably the sparql query is bad formed" | ||
|
||
class EndPointNotFound(SPARQLWrapperException): | ||
""" | ||
End Point Not Found exceptions | ||
""" | ||
|
||
def __init__(self): | ||
SPARQLWrapperException.__init__(self) | ||
|
||
def __str__(self): | ||
return "EndPointNotFound: it was impossible to connect with the endpoint in that address, check if it is correct" | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf8 -*- | ||
|
||
""" | ||
SPARQL Wrapper Utils | ||
@authors: U{Ivan Herman<http://www.ivan-herman.net>}, U{Sergio Fernández<http://www.wikier.org>}, U{Carlos Tejo Alonso<http://www.dayures.net>} | ||
@organization: U{World Wide Web Consortium<http://www.w3.org>} and U{Foundation CTIC<http://www.fundacionctic.org/>}. | ||
@license: U{W3C SOFTWARE NOTICE AND LICENSE<href="http://www.w3.org/Consortium/Legal/copyright-software">} | ||
""" | ||
|
||
import warnings | ||
|
||
def deprecated(func): | ||
""" | ||
This is a decorator which can be used to mark functions | ||
as deprecated. It will result in a warning being emmitted | ||
when the function is used. | ||
@see: http://code.activestate.com/recipes/391367/ | ||
""" | ||
def newFunc(*args, **kwargs): | ||
warnings.warn("Call to deprecated function %s." % func.__name__, category=DeprecationWarning, stacklevel=2) | ||
return func(*args, **kwargs) | ||
newFunc.__name__ = func.__name__ | ||
newFunc.__doc__ = func.__doc__ | ||
newFunc.__dict__.update(func.__dict__) | ||
return newFunc | ||
|
Binary file not shown.
Oops, something went wrong.