Module Literals
source code
Separate module to handle literals.
The issue is that pure literals cannot appear in subject position
according to the current rules on RDF. That means that different types of
conclusions cannot properly finish. The present trick is trying to get
around the problem as follows:
-
For all literals in the graph a bnode is created. The module does not
do a full D entailment but just relies on RDFLib's ability to
recognize identical literals
-
All those bnodes get a type Literal
-
All triples with literals are exchanged against a triple with the
associated bnode
The inferences are then calculated with the modified Graph. At the end
of the process, the above steps are done backwards: for all triples where
a bnode representing a literal appear in object position, a triple is
generated; however, all triples where the bnode appears in a subject
position are removed from the final graph.
|
_LiteralStructure
This class serves as a wrapper around rdflib's Literal, by changing
the equality function to a strict identity of datatypes and lexical
values.
|
|
LiteralProxies
|
|
__author__ = ' Ivan Herman '
|
|
__license__ = u' W3C® SOFTWARE NOTICE AND LICENSE, http://www.w ...
|
|
__package__ = ' RDFClosure '
|
Imports:
BNode,
rdflibLiteral,
ns_xsd,
type,
Literal,
AltXSDToPYTHON
__license__
- Value:
u' W3C® SOFTWARE NOTICE AND LICENSE, http://www.w3.org/Consortium/Legal
/2002/copyright-software-20021231 '
|
|