Ejemplo n.º 1
0
class ImplementationSchema(JsonLDSchema):
    _id = fields.Id()
    name = fields.String(DC_TERMS.title)
    parameters = fields.Nested(ML_SCHEMA.hasHyperParameter,
                               HyperParameterSchema,
                               many=True)
    implements = fields.Nested(ML_SCHEMA.implements, AlgorithmSchema)
    version = fields.String(DC_TERMS.hasVersion)

    class Meta:
        rdf_type = ML_SCHEMA.Implementation
        model = Implementation
Ejemplo n.º 2
0
    class BSchema(JsonLDSchema):
        _id = fields.BlankNodeId()
        value = fields.Nested(schema.specifiedBy, ASchema)

        class Meta:
            rdf_type = schema.B
            model = B
Ejemplo n.º 3
0
    class BSchema(JsonLDSchema):
        value = fields.Nested(schema.specifiedBy, ASchema)

        class Meta:
            rdf_type = schema.B
            model = B
            id_generation_strategy = blank_node_id_strategy
Ejemplo n.º 4
0
class RunSchema(JsonLDSchema):
    _id = fields.Id()
    executes = fields.Nested(ML_SCHEMA.executes, ImplementationSchema)
    input_values = fields.Nested(ML_SCHEMA.hasInput,
                                 HyperParameterSettingSchema,
                                 many=True,
                                 flattened=True)
    output_values = fields.Nested(ML_SCHEMA.hasOutput,
                                  ModelEvaluationSchema,
                                  many=True)
    realizes = fields.Nested(ML_SCHEMA.implements, AlgorithmSchema)
    version = fields.String(DC_TERMS.hasVersion)
    name = fields.String(DC_TERMS.title)

    class Meta:
        rdf_type = ML_SCHEMA.Run
        model = Run
Ejemplo n.º 5
0
    class AuthorSchema(JsonLDSchema):
        _id = fields.Id()
        name = fields.String(schema.name)
        books = fields.Nested(schema.author, BookSchema, reverse=True, many=True)

        class Meta:
            rdf_type = schema.Person
            model = Author
Ejemplo n.º 6
0
    class BookSchema(JsonLDSchema):
        _id = fields.Id()
        name = fields.String(schema.name)
        author = fields.Nested(schema.author, AuthorSchema)

        class Meta:
            rdf_type = schema.Book
            model = Book
Ejemplo n.º 7
0
    class AuthorSchema(JsonLDSchema):
        _id = fields.BlankNodeId()
        name = fields.String(schema.name)
        books = fields.Nested(schema.books, BookSchema, many=True)

        class Meta:
            rdf_type = schema.Author
            model = Author
Ejemplo n.º 8
0
    class BookSchema(JsonLDSchema):
        _id = fields.BlankNodeId()
        name = fields.String(schema.name)
        genre = fields.Nested(schema.genre, GenreSchema)

        class Meta:
            rdf_type = schema.Book
            model = Book
Ejemplo n.º 9
0
    class AuthorSchema(JsonLDSchema):
        _id = fields.Id()
        name = fields.String(schema.name)
        book = fields.Nested(schema.books, BookSchema)

        class Meta:
            rdf_type = schema.Author
            model = Author
Ejemplo n.º 10
0
    class AuthorSchema(JsonLDSchema):
        name = fields.String(schema.name)
        books = fields.Nested(schema.books, BookSchema, many=True)

        class Meta:
            rdf_type = schema.Author
            model = Author
            id_generation_strategy = blank_node_id_strategy
Ejemplo n.º 11
0
    class BookSchema(JsonLDSchema):
        name = fields.String(schema.name)
        genre = fields.Nested(schema.genre, GenreSchema)

        class Meta:
            rdf_type = schema.Book
            model = Book
            id_generation_strategy = blank_node_id_strategy
Ejemplo n.º 12
0
class ModelEvaluationSchema(JsonLDSchema):
    _id = fields.Id()
    value = ParameterValue(ML_SCHEMA.hasValue)
    specified_by = fields.Nested(ML_SCHEMA.specifiedBy,
                                 EvaluationMeasureSchema)

    class Meta:
        rdf_type = ML_SCHEMA.ModelEvaluation
        model = ModelEvaluation
Ejemplo n.º 13
0
class HyperParameterSettingSchema(JsonLDSchema):
    _id = fields.Id()
    value = ParameterValue(ML_SCHEMA.hasValue)
    specified_by = fields.Nested(ML_SCHEMA.specifiedBy,
                                 HyperParameterSchema,
                                 only=("_id", ))

    class Meta:
        rdf_type = ML_SCHEMA.HyperParameterSetting
        model = HyperParameterSetting
        add_value_types = True
Ejemplo n.º 14
0
    class CSchema(JsonLDSchema):
        _id = fields.Id()
        name = fields.String(schema.name)
        children = fields.Nested(schema.parent,
                                 BSchema,
                                 reverse=True,
                                 many=True)

        class Meta:
            rdf_type = schema.C
            model = C
Ejemplo n.º 15
0
    class Author(metaclass=JsonLDAnnotation):
        _id = fields.Id()
        name = fields.String(schema.name)
        books = fields.Nested(schema.author, Book, reverse=True, many=True)

        def __init__(self, _id, name, books):
            self._id = _id
            self.name = name
            self.books = books

        class Meta:
            rdf_type = schema.Person