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      developer = rdfMultiple(DOAP.developer, range_type=FOAF.Person)
    38      translator = rdfMultiple(DOAP.translator, range_type=FOAF.Person)
    39      helper = rdfMultiple(DOAP.helper, range_type=FOAF.Person)
    40      tester = rdfMultiple(DOAP.tester, range_type=FOAF.Person)
    41      documenter = rdfMultiple(DOAP.documenter, range_type=FOAF.Person)
    42      module = rdfSingle(DOAP.module)
    43      name = rdfSingle(DOAP.name)
    44      old_homepage = rdfMultiple(DOAP['old-homepage'])
    45      programming_language = rdfMultiple(DOAP['programming-language'])
    46      releases = rdfMultiple(DOAP.release, range_type=DOAP.Version)
    47      svn_repository = rdfSingle(DOAP.repository, 'svn_repository',
    48              range_type=DOAP.SVNRepository)
    49      cvs_repository = rdfSingle(DOAP.repository, 'cvs_repository',
    50              range_type=DOAP.CVSRepository)
    51      oper_sys = rdfMultiple(DOAP['os'])
    52      screenshots = rdfMultiple(DOAP.screenshots)
    53      shortdesc = rdfMultiple(DOAP.shortdesc)
    54      tester = rdfMultiple(DOAP.tester, range_type=FOAF.Person)
    55      translator = rdfMultiple(DOAP.translator, range_type=FOAF.Person)
    56      wiki = rdfMultiple(DOAP.wiki)
    57
    58 -class Release(rdfSubject):
    59      """A release class"""
    60      rdf_type = DOAP.Version
    61      revision = rdfSingle(DOAP.revision)
    62      name = rdfSingle(DOAP.name)
    63      created = rdfSingle(DOAP.created)
    64      file_releases = rdfMultiple(DOAP['file-release'])
    65
    66 -class SVNRepository(rdfSubject):
    67      """Subversion repository classs"""
    68      rdf_type = DOAP.SVNRepository
    69      location = rdfSingle(DOAP.location)
    70      svn_browse = rdfSingle(DOAP.browse)
    71
    72 -class CVSRepository(rdfSubject):
    73      """CVS repository class"""
    74      rdf_type = DOAP.CVSRepository
    75      anon_root = rdfSingle(DOAP['anon-root'])
    76      cvs_browse = rdfSingle(DOAP.browse)
    77      module = rdfSingle(DOAP.module)
    78
    79
    80  mapper(Project, Release, CVSRepository, SVNRepository)
    81