예제 #1
0
    class GenreSchema(JsonLDSchema):
        _id = fields.BlankNodeId()
        name = fields.String(schema.name)

        class Meta:
            rdf_type = schema.Genre
            model = Genre
예제 #2
0
    class BSchema(JsonLDSchema):
        _id = fields.BlankNodeId()
        value = fields.Nested(schema.specifiedBy, ASchema)

        class Meta:
            rdf_type = schema.B
            model = B
예제 #3
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
예제 #4
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