RDFClosure.Literals

Package RDFClosure :: Module Literals |
[hide private]
[frames] | no frames]

# 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:

1. 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
2. All those bnodes get a type Literal
3. 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.

Requires: RDFLib, 4.0.0 and higher

License: This software is available for use under the W3C Software License

Organization: World Wide Web Consortium

Author: Ivan Herman

Contact: Ivan Herman, ivan@w3.org

Classes | [hide private]
| _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

Variables | [hide private]
| __author__ = ``'``Ivan Herman``'``
| __license__ = ``u'``W3C® SOFTWARE NOTICE AND LICENSE, http://www.w``...``
| __package__ = ``'``RDFClosure``'``

Imports: BNode, rdflibLiteral, ns_xsd, type, Literal, AltXSDToPYTHON

Variables Details | [hide private]

  ### __license__ Value:
      u'W3C® SOFTWARE NOTICE AND LICENSE, http://www.w3.org/Consortium/Legal
      /2002/copyright-software-20021231'