Package rdfalchemy :: Module descriptors
[hide private]
[frames] | no frames]

Module descriptors

source code

descriptors.py

Created by Philip Cooper on 2008-02-03. Copyright (c) 2008 Openvest. All rights reserved.

Classes [hide private]
  rdfAbstract
Abstract base class for descriptors Descriptors are to map class instance variables to predicates optional cacheName is where to store items range_type is the rdf:type of the range of this predicate
  rdfSingle
This is a Discriptor Takes a the URI of the predicate at initialization Expects to return a single item on Assignment will set that value to the ONLY triple with that subject,predicate pair
  rdfMultiple
This is a Discriptor Expects to return a list of values (could be a list of one)
  rdfBest
This is a Discriptor that returns one value that is the "best" result out of possible multiple matches
  rdfLocale
This is like rdfBest with a predefined select_fun to select from multiple choices like labels or comments and select the one with the correct locale
  rdfList
This is a Discriptor Expects to return a list of values (could be a list of one) __set__ will set the predicate as a RDF List
  rdfContainer
This is a Discriptor Expects to return a list of values (could be a list of one)
  owlTransitive
owlTransitive is a descriptor based on a transitive predicate The predicate should be of type owl:TransitiveProperty
Functions [hide private]
 
getList(sub, pred=None, db=None)
Attempts to return a list from sub (subject that is) passed in if it is a Collection or a Container (Bag,Seq or Alt)
source code
 
value2object(value)
suitable for a triple takes a value and returns a Literal, URIRef or BNode suitable for a triple
source code
Variables [hide private]
  log = logging.getLogger(__name__)
  RDF = rdflib.URIRef('http://www.w3.org/1999/02/22-rdf-syntax-n...
Variables Details [hide private]

RDF

Value:
rdflib.URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#')