doapfiend.model

Package doapfiend :: Module model |
[hide private]
[frames] | no frames]

# Source Code for Module doapfiend.model

     1
     2  '''
     3
     4  Model of a DOAP profile using RDFAlchemy
     5
     6  '''
     7
     8  from rdfalchemy import rdfSubject, rdfSingle, rdfMultiple
     9  from rdfalchemy.orm import mapper
    10  from rdflib import Namespace
    11
    12  DOAP = Namespace("http://usefulinc.com/ns/doap#")
    13  FOAF = Namespace("http://xmlns.com/foaf/0.1/")
    14
    15
    16 -class Project(rdfSubject):
    17
    18      """
    19      DOAP Project Class
    20      """
    21
    22      rdf_type = DOAP.Project
    23
    24      category = rdfMultiple(DOAP.category)
    25      created = rdfSingle(DOAP.created)
    26      shortname = rdfSingle(DOAP.shortname)
    27      description = rdfMultiple(DOAP.description)
    28      bug_database = rdfSingle(DOAP['bug-database'])
    29      developer = rdfMultiple(DOAP.developer, range_type=FOAF.Person)
    30      documenter = rdfMultiple(DOAP.documenter, range_type=FOAF.Person)
    31      download_mirror = rdfMultiple(DOAP['downoad-mirror'])
    32      download_page = rdfSingle(DOAP['download-page'])
    33      helper = rdfMultiple(DOAP.helper, range_type=FOAF.Person)
    34      homepage = rdfSingle(DOAP.homepage)
    35      license = rdfMultiple(DOAP['license'])
    36      maintainer = rdfMultiple(DOAP.maintainer, range_type=FOAF.Person)
    37      module = rdfSingle(DOAP.module)
    38      name = rdfSingle(DOAP.name)
    39      old_homepage = rdfMultiple(DOAP['old-homepage'])
    40      programming_language = rdfMultiple(DOAP['programming-language'])
    41      releases = rdfMultiple(DOAP.release, range_type=DOAP.Version)
    42      svn_repository = rdfSingle(DOAP.repository, 'svn_repository',
    43              range_type=DOAP.SVNRepository)
    44      cvs_repository = rdfSingle(DOAP.repository, 'cvs_repository',
    45              range_type=DOAP.CVSRepository)
    46      oper_sys = rdfMultiple(DOAP['os'])
    47      screenshots = rdfMultiple(DOAP.screenshots)
    48      shortdesc = rdfMultiple(DOAP.shortdesc)
    49      tester = rdfMultiple(DOAP.tester, range_type=FOAF.Person)
    50      translator = rdfMultiple(DOAP.translator, range_type=FOAF.Person)
    51      wiki = rdfMultiple(DOAP.wiki)
    52
    53 -class Release(rdfSubject):
    54      """A release class"""
    55      rdf_type = DOAP.Version
    56      revision = rdfSingle(DOAP.revision)
    57      name = rdfSingle(DOAP.name)
    58      created = rdfSingle(DOAP.created)
    59      file_releases = rdfMultiple(DOAP['file-release'])
    60
    61 -class SVNRepository(rdfSubject):
    62      """Subversion repository classs"""
    63      rdf_type = DOAP.SVNRepository
    64      location = rdfSingle(DOAP.location)
    65      svn_browse = rdfSingle(DOAP.browse)
    66
    67 -class CVSRepository(rdfSubject):
    68      """CVS repository class"""
    69      rdf_type = DOAP.CVSRepository
    70      anon_root = rdfSingle(DOAP['anon-root'])
    71      cvs_browse = rdfSingle(DOAP.browse)
    72      module = rdfSingle(DOAP.module)
    73
    74
    75  mapper(Project, Release, CVSRepository, SVNRepository)
    76