class Item(Part): title = localized(T) relations = each(T.relation) >> THIS_QUERY unaryRelation = one(T) >> Part partlist = collection(T) >> Part multiple_partlist = collection(multiple=True) >> Part xmlData = localized_xml(T) titleLang = i18n_dict(T['title']) labels = each_localized(T.label)
class FilteredItem(RdfQuery): sortedKeywords = each(T.keyword) | Sorter() sortedKeywordsReversed = each(T.keyword) | Sorter(reverse=True) sortedRelations_attr = each(T.relation) >> Item | \ Sorter('name', reverse=True) sortedRelations_func = each(T.relation) >> Item |\ Sorter(lambda r: getattr(r, 'name'), reverse=True) someKeywords = each(T.keyword) | Filter(lambda v: v in ('q', 'r', 'y')) name_upper = one(T.name) | (lambda v: unicode(v).upper())
class Typed(RdfQuery): rdfType = one(RDF.type)
class Lang(RdfQuery): value = one(RDF) label = i18n_dict(RDFS)
class Part(RdfQuery): name = one(T)
class MarkedPart(RdfQuery): name = one(T) related = one_where_self_is(T.unaryRelation) >> 'MarkedItem'
class MarkedItem(RdfQuery): title = localized(T) relations = each(T.relation) >> 'MarkedItem' unaryRelation = one(T) >> 'MarkedPart' annotated = one(T.unaryRelation) >> 'oort.util.queries:Annotated'
class TypedImplicitItem(RdfQuery): _rdfbase_ = T RDF_TYPE = T.OtherType name = one() partlist = collection() >> Part
class ImplicitItem(RdfQuery): _rdfbase_ = T name = one()