示例#1
0
def _t(subject, label, *rests, def_=None, synonyms=tuple(), comment=None,
       equivalentClass=oec):
    members = tuple()
    _rests = tuple()
    for rest in rests:
        if isinstance(rest, tuple):
            if len(rest) == 2:
                _rests += rest,
            else:
                raise ValueError(f'length of {rest} is not 2!')
        elif isinstance(rest, Combinator):
            members += rest,
        else:
            members += rest,

    rests = _rests
    if not members:
        members = ilxtr.technique,

    yield from oc(subject)
    yield from equivalentClass.serialize(subject, *members, *restrictions(*rests))
    yield from olit(subject, rdfs.label, label)
    if def_:
        yield from olit(subject, definition, def_)

    if synonyms:
        if not isinstance(synonyms, tuple):
            # this is why python sucks and racket is awesome if this was racket
            # the error would show up on the line where the problem was :/
            raise TypeError(f'Type of {synonyms!r} should not be {type(synonyms)}!')
        yield from olit(subject, NIFRID.synonym, *synonyms)

    if comment:
        yield from olit(subject, rdfs.comment, comment)
示例#2
0
文件: core.py 项目: gsanou/pyontutils
    #oop(ilxtr.hasMaterialAspectContext, ilxtr.hasContext)
    oop(ilxtr.processHasContext),
    (ilxtr.processHasContext, rdfs.domain, BFO['0000015']),

    # aspects for processes
    # these are not modelled with a notion of intention because
    # they are processes which _must_ occur in order to be classified as such

    # FIXME TODO naming, Required?
    oop(ilxtr.hasActualPrimaryAspect),
    oop(ilxtr.hasActualPrimaryAspect_dAdT),

    # classes

    ## executor
    oc(ilxtr.executor,
       ilxtr.materialEntity),  # probably equivalent to agent in ero
    olit(ilxtr.executor, rdfs.label, 'executor'),
    olit(ilxtr.executor, NIFRID.synonym, 'executing agent'),
    olit(
        ilxtr.executor, definition,
        'An executor is the primary agentous being that participates in a '
        'technique and is usually the vehicle by which prior information '
        'constrains a technique. Human beings usually play this role, but '
        'computers and robots can be considered to be executors when the prior '
        'information has been encoded directly into them and their behavior.'),

    ## aspect
    oc(BFO['0000019']),  # XXX  # vs PATO:0000001 quality:
    olit(BFO['0000019'], rdfs.label, 'quality'),  # XXX
    oc(ilxtr.aspect, BFO['0000019']),  # FIXME aspect/
    olit(ilxtr.aspect, rdfs.label, 'aspect'),
示例#3
0
restHasValue = Restriction(None, owl.hasValue)

filename = 'methods-helper'
prefixes = None
OntCuries['HBP_MEM'] = 'http://www.hbp.FIXME.org/hbp_measurement_methods/'
#OntCuries['HBP_MEM'] = 'http://www.hbp.FIXME.org/hbp_measurement_methods/'
#imports = NIFTTL['nif_backend.ttl'],
imports = methods_core.iri,
comment = 'helper for methods development'
_repo = True
debug = True

triples = ((tech.injection, owl.equivalentClass, OntTerm('BIRNLEX:2135')), )

triples += (  # protocols
    oc(prot.CLARITY, ilxtr.protocol),
    oc(prot.deepSequencing, ilxtr.protocol),
    oc(prot.sangerSequencing, ilxtr.protocol),
    oc(prot.shotgunSequencing, ilxtr.protocol),
    oc(prot.fMRI, ilxtr.protocol),
    oc(prot.dwMRI, ilxtr.protocol),
    oc(prot.DTI, ilxtr.protocol),
)

triples += (  # information entity

    # information entities
    oc(ilxtr.informationEntity),
    olit(ilxtr.informationEntity, rdfs.label, 'information entity'),
    olit(ilxtr.informationEntity, definition,
         'Any physically encoded information.'),