notation3 | index /devel/WWW/2000/10/swap/notation3.py |
$Id: notation3.html,v 1.41 2004/10/28 17:41:59 timbl Exp $
This module implements basic sources and sinks for RDF data.
It defines a stream interface for such data.
It has a command line interface, can work as a web query engine,
and has built in test(), all of which demosntrate how it is used.
To make a new RDF processor, subclass RDFSink.
See also:
Notation 3
http://www.w3.org/DesignIssues/Notation3
Closed World Machine - and RDF Processor
http;//www.w3.org/2000/10/swap/cwm
To DO: See also "@@" in comments
Internationlization:
- Decode incoming N3 file as unicode
- Encode outgoing file
- unicode \u (??) escapes in parse
- unicode \u (??) escapes in string output
Note currently unicode strings work in this code
but fail when they are output into the python debugger
interactive window.
______________________________________________
Module originally by Dan Connolly, includeing notation3
parser and RDF generator. TimBL added RDF stream model
and N3 generation, replaced stream model with use
of common store/formula API.
DWC:
oops... I'm not doing qname expansion as described
there (i.e. adding a # if it's not already there).
I allow unprefixed qnames, so not all barenames
are keywords.
---- hmmmm ... not expandable - a bit of a trap.
I haven't done quoting yet.
idea: migrate toward CSS notation?
idea: use notation3 for wiki record keeping.
Modules | ||||||
|
Classes | ||||||||||||||||||||||||||
|
Functions | ||
|
Data | ||
ADDED_HASH = '#' ALL4 = (0, 1, 2, 3) ANONYMOUS = 3 CONTEXT = 0 DAML_sameAs = (0, 'http://www.w3.org/2002/07/owl#sameAs') DAML_sameAs_URI = 'http://www.w3.org/2002/07/owl#sameAs' DECIMAL_DATATYPE = 'http://www.w3.org/2001/XMLSchema#decimal' Escapes = {'"': '"', r'\': r'\', 'a': '\x07', 'b': '\x08', 'f': '\x0c', 'n': '\n', 'r': '\r', 't': '\t', 'v': '\x0b'} FLOAT_DATATYPE = 'http://www.w3.org/2001/XMLSchema#double' INTEGER_DATATYPE = 'http://www.w3.org/2001/XMLSchema#integer' LITERAL = 2 LOG_implies_URI = 'http://www.w3.org/2000/10/swap/log#implies' List_NS = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' Logic_NS = 'http://www.w3.org/2000/10/swap/log#' N3CommentCharacter = '#' N3_Empty = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#Empty') N3_List = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#List') N3_first = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first') N3_forAll_URI = 'http://www.w3.org/2000/10/swap/log#forAll' N3_forSome_URI = 'http://www.w3.org/2000/10/swap/log#forSome' N3_nil = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil') N3_rest = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest') OBJ = 3 PARTS = (1, 2, 3) PRED = 1 RDF_NS_URI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' RDF_spec = 'http://www.w3.org/TR/REC-rdf-syntax/' RDF_type = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type') RDF_type_URI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' SUBJ = 2 SYMBOL = 0 __file__ = './notation3.pyc' __name__ = 'notation3' _notNameChars = '\t\r\n !"#$%&\'()*.,+/;<=>?@[\\]^`{|}~:' _notQNameChars = '\t\r\n !"#$%&\'()*.,+/;<=>?@[\\]^`{|}~' _rdfns = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' digitstring = <_sre.SRE_Pattern object> eof = <_sre.SRE_Pattern object> eol = <_sre.SRE_Pattern object> forbidden1 = <_sre.SRE_Pattern object> forbidden2 = <_sre.SRE_Pattern object> interesting = <_sre.SRE_Pattern object> langcode = <_sre.SRE_Pattern object> number_syntax = <_sre.SRE_Pattern object> option_noregen = 0 parsesTo_URI = 'http://www.w3.org/2000/10/swap/log#parsesTo' signed_integer = <_sre.SRE_Pattern object> ws = <_sre.SRE_Pattern object> |