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  DC = Namespace("http://purl.org/dc/elements/1.1/")
    15
    16
    17 -class Project(rdfSubject):
    18
    19      """
    20      DOAP Project Class
    21      """
    22
    23      rdf_type = DOAP.Project
    24
    25      category = rdfMultiple(DOAP.category)
    26      created = rdfSingle(DOAP.created)
    27      shortname = rdfSingle(DOAP.shortname)
    28      description = rdfMultiple(DOAP.description)
    29      bug_database = rdfSingle(DOAP['bug-database'])
    30      developer = rdfMultiple(DOAP.developer, range_type=FOAF.Person)
    31      documenter = rdfMultiple(DOAP.documenter, range_type=FOAF.Person)
    32      download_mirror = rdfMultiple(DOAP['downoad-mirror'])
    33      download_page = rdfSingle(DOAP['download-page'])
    34      helper = rdfMultiple(DOAP.helper, range_type=FOAF.Person)
    35      homepage = rdfSingle(DOAP.homepage)
    36      license = rdfMultiple(DOAP['license'])
    37      maintainer = rdfMultiple(DOAP.maintainer, range_type=FOAF.Person)
    38      developer = rdfMultiple(DOAP.developer, range_type=FOAF.Person)
    39      translator = rdfMultiple(DOAP.translator, range_type=FOAF.Person)
    40      helper = rdfMultiple(DOAP.helper, range_type=FOAF.Person)
    41      tester = rdfMultiple(DOAP.tester, range_type=FOAF.Person)
    42      documenter = rdfMultiple(DOAP.documenter, range_type=FOAF.Person)
    43      module = rdfSingle(DOAP.module)
    44      name = rdfSingle(DOAP.name)
    45      old_homepage = rdfMultiple(DOAP['old-homepage'])
    46      programming_language = rdfMultiple(DOAP['programming-language'])
    47      releases = rdfMultiple(DOAP.release, range_type=DOAP.Version)
    48      svn_repository = rdfSingle(DOAP.repository, 'svn_repository',
    49              range_type=DOAP.SVNRepository)
    50      cvs_repository = rdfSingle(DOAP.repository, 'cvs_repository',
    51              range_type=DOAP.CVSRepository)
    52      oper_sys = rdfMultiple(DOAP['os'])
    53      screenshots = rdfMultiple(DOAP.screenshots)
    54      shortdesc = rdfMultiple(DOAP.shortdesc)
    55      tester = rdfMultiple(DOAP.tester, range_type=FOAF.Person)
    56      translator = rdfMultiple(DOAP.translator, range_type=FOAF.Person)
    57      wiki = rdfMultiple(DOAP.wiki)
    58
    59 -class Release(rdfSubject):
    60      """A release class"""
    61      rdf_type = DOAP.Version
    62      revision = rdfSingle(DOAP.revision)
    63      name = rdfSingle(DOAP.name)
    64      created = rdfSingle(DOAP.created)
    65      changelog = rdfSingle(DC.description)
    66      file_releases = rdfMultiple(DOAP['file-release'])
    67
    68 -class SVNRepository(rdfSubject):
    69      """Subversion repository classs"""
    70      rdf_type = DOAP.SVNRepository
    71      location = rdfSingle(DOAP.location)
    72      svn_browse = rdfSingle(DOAP.browse)
    73
    74 -class CVSRepository(rdfSubject):
    75      """CVS repository class"""
    76      rdf_type = DOAP.CVSRepository
    77      anon_root = rdfSingle(DOAP['anon-root'])
    78      cvs_browse = rdfSingle(DOAP.browse)
    79      module = rdfSingle(DOAP.module)
    80
    81
    82  mapper(Project, Release, CVSRepository, SVNRepository)
    83