示例#1
0
                                  required=False,
                                  choices=[2, 10, 20, 30, 40, 50],
                                  default=10,
                                  help='Results per page {error_msg}')

# transient data model

from flask_restplus import fields
variantset = api.model(
    'variant set', {
        'id':
        fields.Integer(readOnly=True,
                       description='The unique identifier of a variant set'),
        'title':
        fields.String(required=True, description='Article title'),
        'body':
        fields.String(required=True, description='Article content'),
        'pub_date':
        fields.DateTime,
        'category_id':
        fields.Integer(attribute='category.id'),
        'category':
        fields.String(attribute='category.id'),
    })

pagination = api.model(
    'A page of results', {
        'page':
        fields.Integer(description='Number of this page of results'),
        'pages':
        fields.Integer(description='Total number of pages of results'),
        'per_page':
from flask_restplus import fields
from biolink.api.restplus import api

abstract_property_value = api.model('AbstractPropertyValue', {
    'val': fields.String(readOnly=True, description='value part'),
    'pred': fields.String(readOnly=True, description='predicate (attribute) part'),
    'xrefs': fields.List(fields.String, description='Xrefs provenance for property-value'),
})

synonym_property_value = api.inherit('SynonymPropertyValue', abstract_property_value, {
})

xref_property_value = api.inherit('SynonymPropertyValue', abstract_property_value, {
})

definition_property_value = api.inherit('DefinitionPropertyValue', abstract_property_value, {
})

basic_property_value = api.inherit('DefinitionPropertyValue', abstract_property_value, {
})

meta = api.model('Meta', {
    'definition': fields.Nested(definition_property_value), description='definition plus source'),
    'comments': fields.List(fields.String(readOnly=True), description='comments'),
    'subsets': fields.List(fields.String(readOnly=True), description='subsets (slims)'),
    'xrefs': fields.List(fields.Nested(xref_property_value)), description='xrefs plus source'),
    'synonyms': fields.List(fields.Nested(synonym_property_value)), description='synonyms plus scope, type and source'),
    'basic_property_values': fields.List(fields.Nested(basic_property_value)), description='synonyms plus scope, type and source'),
})

示例#3
0
from flask_restplus import fields
from biolink.api.restplus import api

# todo: split this into modules

# Solr

search_result = api.model(
    'SearchResult', {
        'numFound': fields.Integer,
        'start': fields.Integer,
        'facet_counts': fields.Raw
    })

## BBOP/OBO Graphs

node = api.model(
    'Node', {
        'id': fields.String(readOnly=True, description='ID'),
        'lbl': fields.String(readOnly=True, description='RDFS Label')
    })

edge = api.model(
    'Edge', {
        'sub': fields.String(readOnly=True, description='Subject Node ID'),
        'pred': fields.String(readOnly=True,
                              description='Predicate (Relation) ID'),
        'obj': fields.String(readOnly=True, description='Subject Node ID'),
    })

bbop_graph = api.model(
from flask_restplus import fields
from biolink.api.restplus import api
from biolink.datamodel.serializers import named_object_core

# Schema for posting to /sim/score
features = api.model(
    'Feature', {
        'id':
        fields.String(description='curie formatted id'),
        'label':
        fields.String(description='curie formatted id'),
        'type':
        fields.String(description='feature type (only phenotype supported)'),
        'isPresent':
        fields.Boolean(description='is the feature present')
    })

sufficiency_input = api.model(
    'SufficiencyPostInput', {
        'id':
        fields.String(description='curie formatted id'),
        'features':
        fields.List(fields.Nested(features), description='list of features')
    })

# Schema for output document for annotation sufficiency
sufficiency_output = api.model(
    'SufficiencyOutput', {
        'simple_score': fields.Float(description='simple score'),
        'scaled_score': fields.Float(description='scaled score'),
        'categorical_score': fields.Float(description='categorical score'),
示例#5
0
from flask_restplus import fields
from biolink.api.restplus import api

# todo: split this into modules
# TODO: convert to marshmallow

# Solr

search_result = api.model(
    'SearchResult', {
        'numFound':
        fields.Integer(
            description='total number of associations matching query'),
        'docs':
        fields.List(fields.Raw, description='solr docs'),
        'facet_counts':
        fields.Raw(
            description='Mapping between field names and association counts'),
        'highlighting':
        fields.Raw(description='Mapping between id and solr highlight')
    })

autocomplete_result = api.model(
    'AutocompleteResult', {
        'id':
        fields.String(description='curie formatted id'),
        'label':
        fields.List(fields.String, description='primary label (rdfs:label)'),
        'match':
        fields.String(
            description=
示例#6
0
from flask_restplus import fields
from biolink.api.restplus import api

abstract_property_value = api.model(
    'AbstractPropertyValue', {
        'val':
        fields.String(readOnly=True, description='value part'),
        'pred':
        fields.String(readOnly=True, description='predicate (attribute) part'),
        'xrefs':
        fields.List(fields.String,
                    description='Xrefs provenance for property-value'),
    })

synonym_property_value = api.inherit('SynonymPropertyValue',
                                     abstract_property_value, {})

xref_property_value = api.inherit('SynonymPropertyValue',
                                  abstract_property_value, {})

definition_property_value = api.inherit('DefinitionPropertyValue',
                                        abstract_property_value, {})

basic_property_value = api.inherit('DefinitionPropertyValue',
                                   abstract_property_value, {})

meta = api.model(
    'Meta', {
        'definition':
        fields.Nested(definition_property_value,
                      description='definition plus source'),
示例#7
0
from flask_restplus import fields
from biolink.api.restplus import api

# todo: split this into modules
# TODO: convert to marshmallow

# Solr

search_result = api.model(
    'SearchResult', {
        'numFound':
        fields.Integer(
            description='total number of associations matching query'),
        'start':
        fields.Integer(description='Cursor position'),
        'facet_counts':
        fields.Raw(
            description='Mapping between field names and association counts'),
        'facet_pivot':
        fields.Raw(description='Populated in facet_pivots is passed'),
    })

## BBOP/OBO Graphs

abstract_property_value = api.model(
    'AbstractPropertyValue', {
        'val':
        fields.String(readOnly=True, description='value part'),
        'pred':
        fields.String(readOnly=True, description='predicate (attribute) part'),
        'xrefs':
示例#8
0
from flask_restplus import fields
from biolink.api.restplus import api

abstract_property_value = api.model(
    'AbstractPropertyValue', {
        'val':
        fields.String(readOnly=True, description='value part'),
        'pred':
        fields.String(readOnly=True, description='predicate (attribute) part'),
        'xrefs':
        fields.List(fields.String,
                    description='Xrefs provenance for property-value'),
    })

annotatable = api.model('Annotatable', {})

model = api.model(
    'Model', {
        'id':
        fields.String(description='unique ID/CURIE/URI'),
        'title':
        fields.String(description='textual description'),
        'state':
        fields.String(description='production or development'),
        'contributors':
        fields.List(fields.String(),
                    description='list of IRIs of contributors'),
    })

type_reference = api.model(
    'TypeReference', {