goat package

Submodules

goat.admin module

class goat.admin.AuthorityAdmin(model, admin_site)[source]

Bases: guardian.admin.GuardedModelAdmin

media
class goat.admin.ConceptAdmin(model, admin_site)[source]

Bases: guardian.admin.GuardedModelAdmin

media
class goat.admin.IdentityAdmin(model, admin_site)[source]

Bases: guardian.admin.GuardedModelAdmin

media
class goat.admin.IdentitySystemAdmin(model, admin_site)[source]

Bases: guardian.admin.GuardedModelAdmin

media

goat.apps module

class goat.apps.GoatConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

name = 'goat'
ready()[source]
verbose_name = 'Goat'

goat.celery module

goat.filters module

class goat.filters.ConceptFilter(data=None, queryset=None, prefix=None, strict=None)[source]

Bases: django_filters.filterset.FilterSet

class Meta[source]
fields = ['name', 'identifier', 'concept_type', 'added_by', 'authority']
model

alias of Concept

order_by = (('name', 'Name (ascending)'), ('-name', 'Name (descending)'), ('concept_type', 'Type (ascending)'), ('-concept_type', 'Type (descending)'))
ConceptFilter.base_filters = OrderedDict([('name', <django_filters.filters.MethodFilter object>), ('identifier', <django_filters.filters.CharFilter object>), ('concept_type', <django_filters.filters.ModelChoiceFilter object>), ('added_by', <django_filters.filters.ModelChoiceFilter object>), ('authority', <django_filters.filters.ModelChoiceFilter object>), ('search', <django_filters.filters.CharFilter object>), (u'o', <django_filters.filters.OrderingFilter object>)])
ConceptFilter.declared_filters = OrderedDict([('name', <django_filters.filters.MethodFilter object>), ('search', <django_filters.filters.CharFilter object>), ('concept_type', <django_filters.filters.ModelChoiceFilter object>)])
ConceptFilter.lookup_name_in_parts(queryset, value)[source]

goat.models module

class goat.models.Authority(*args, **kwargs)[source]

Bases: goat.models.BasicAccessionMixin

An Authority service, system, file, or other source of concepts.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Authority.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Authority.accepts(method, *params)[source]
Authority.added_by

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

Authority.builtin_identity_system

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

Authority.builtin_identity_system_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Authority.concepts

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Authority.configuration

JSON-serialized configuration (if available) for this authority.

Authority.description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Authority.get_next_by_added(*moreargs, **morekwargs)
Authority.get_next_by_updated(*moreargs, **morekwargs)
Authority.get_previous_by_added(*moreargs, **morekwargs)
Authority.get_previous_by_updated(*moreargs, **morekwargs)
Authority.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Authority.name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Authority.namespace

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Authority.objects = <django.db.models.manager.Manager object>
Authority.search
class goat.models.BasicAccessionMixin(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Basic data tracking information.

class Meta[source]
abstract = False
BasicAccessionMixin.added

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

BasicAccessionMixin.added_by

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

BasicAccessionMixin.added_by_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

BasicAccessionMixin.get_next_by_added(*moreargs, **morekwargs)
BasicAccessionMixin.get_next_by_updated(*moreargs, **morekwargs)
BasicAccessionMixin.get_previous_by_added(*moreargs, **morekwargs)
BasicAccessionMixin.get_previous_by_updated(*moreargs, **morekwargs)
BasicAccessionMixin.updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class goat.models.Concept(*args, **kwargs)[source]

Bases: goat.models.BasicAccessionMixin

Represents a single entry in an authority service or system.

For example, this might be an entry for a particular person in the Library of Congress or VIAF.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Concept.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Concept.added_by

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

Concept.authority

The authority system to which this concept belongs.

Concept.authority_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Concept.concept_type

Some authority systems may have type ontologies. Types should be treated as concepts.

Concept.concept_type_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Concept.data

JSON-pickled data about this concept from the authority service.

Concept.description

If available, a freeform description provided by the authority.

Concept.get_next_by_added(*moreargs, **morekwargs)
Concept.get_next_by_updated(*moreargs, **morekwargs)
Concept.get_previous_by_added(*moreargs, **morekwargs)
Concept.get_previous_by_updated(*moreargs, **morekwargs)
Concept.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Concept.identifier

The URI for this concept.

Concept.identities

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Concept.instances

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Concept.local_identifier

The symbol used by authority internally to identify this concept.

Concept.name

Primary name or label, used for search and display.

Concept.objects = <django.db.models.manager.Manager object>
Concept.save(*args, **kwargs)[source]
Concept.search_sets

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class goat.models.Identity(*args, **kwargs)[source]

Bases: goat.models.BasicAccessionMixin

An identity proposition about a set of concepts.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Identity.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Identity.added_by

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

Identity.concepts

The concepts asserted to be identical.

Identity.confidence

This can (optionally) be used to express relative confidence levels.

Identity.get_next_by_added(*moreargs, **morekwargs)
Identity.get_next_by_updated(*moreargs, **morekwargs)
Identity.get_previous_by_added(*moreargs, **morekwargs)
Identity.get_previous_by_updated(*moreargs, **morekwargs)
Identity.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Identity.name

Can be used to provide an appellation for the cluster of concepts.

Identity.objects = <django.db.models.manager.Manager object>
Identity.part_of

The system to which this identity belongs.

Identity.part_of_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class goat.models.IdentitySystem(*args, **kwargs)[source]

Bases: goat.models.BasicAccessionMixin

An identity system organizes a set of identity propositions about concepts.

This allows many different identity models to coexist for different purposes, without having to commit to a particular view of the world.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception IdentitySystem.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

IdentitySystem.added_by

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

IdentitySystem.authority_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

IdentitySystem.get_next_by_added(*moreargs, **morekwargs)
IdentitySystem.get_next_by_updated(*moreargs, **morekwargs)
IdentitySystem.get_previous_by_added(*moreargs, **morekwargs)
IdentitySystem.get_previous_by_updated(*moreargs, **morekwargs)
IdentitySystem.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

IdentitySystem.identities

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

IdentitySystem.name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

IdentitySystem.objects = <django.db.models.manager.Manager object>
class goat.models.SearchResultSet(id, added_by, added, updated, created, task_id, state)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SearchResultSet.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SearchResultSet.PENDING = 'PENDING'
SearchResultSet.SUCCESS = 'SUCCESS'
SearchResultSet.added

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

SearchResultSet.added_by

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

SearchResultSet.added_by_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

SearchResultSet.created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

SearchResultSet.get_next_by_added(*moreargs, **morekwargs)
SearchResultSet.get_next_by_created(*moreargs, **morekwargs)
SearchResultSet.get_next_by_updated(*moreargs, **morekwargs)
SearchResultSet.get_previous_by_added(*moreargs, **morekwargs)
SearchResultSet.get_previous_by_created(*moreargs, **morekwargs)
SearchResultSet.get_previous_by_updated(*moreargs, **morekwargs)
SearchResultSet.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

SearchResultSet.objects = <django.db.models.manager.Manager object>
SearchResultSet.results

Refers to Concept instances that comprise the outcome of the search.

SearchResultSet.state

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

SearchResultSet.task_id

The identifier of the asynchronous search task.

SearchResultSet.updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

goat.serializers module

class goat.serializers.AuthorityDetailSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]
fields = '__all__'
model

alias of Authority

AuthorityDetailSerializer.validate_configuration(value)[source]

If a configuration is provided, ensure that it is valid JSON.

class goat.serializers.AuthorityLightSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]
fields = ('id', 'name', 'added_by')
model

alias of Authority

class goat.serializers.AuthoritySerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

Identical to AuthorityDetailSerializer except that the configuration is hidden.

class Meta[source]
exclude = ('configuration',)
model

alias of Authority

class goat.serializers.ConceptLightSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]
exclude = ('data',)
model

alias of Concept

class goat.serializers.ConceptRepresentationMixin(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]
fields = '__all__'
model

alias of Identity

ConceptRepresentationMixin.to_internal_value(data)[source]

Concepts can be passed as IDs, or as URIs.

ConceptRepresentationMixin.to_representation(obj)[source]

Concepts should be represented as URIs.

class goat.serializers.ConceptSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]
exclude = ('data',)
model

alias of Concept

class goat.serializers.IdentityLightSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: goat.serializers.ConceptRepresentationMixin, rest_framework.serializers.ModelSerializer

class Meta[source]
fields = '__all__'
model

alias of Identity

class goat.serializers.IdentitySerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: goat.serializers.ConceptRepresentationMixin, rest_framework.serializers.ModelSerializer

class Meta[source]
fields = '__all__'
model

alias of Identity

class goat.serializers.IdentitySystemLightSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]
fields = ('id', 'name', 'added_by')
model

alias of IdentitySystem

class goat.serializers.IdentitySystemSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]
fields = '__all__'
model

alias of IdentitySystem

class goat.serializers.UserSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]
fields = ('username', 'email')
model

alias of User

goat.settings module

Django settings for goat project.

Generated by ‘django-admin startproject’ using Django 1.8.3.

For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/

For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/

goat.signals module

goat.signals.authority_post_save(sender, **kwargs)[source]
goat.signals.concept_post_save(sender, **kwargs)[source]
goat.signals.identity_post_save(sender, **kwargs)[source]
goat.signals.identity_system_post_save(sender, **kwargs)[source]
goat.signals.user_post_save(sender, **kwargs)[source]

All users should be able to create by default.

goat.tasks module

goat.urls module

goat URL Configuration

goat.views module

class goat.views.AuthorityViewSet(**kwargs)[source]

Bases: goat.views.CreateWithUserInfoMixin, rest_framework.viewsets.ModelViewSet

create(request, *args, **kwargs)[source]

Populates the added_by field with the current user.

filter_backends = (<class 'django_filters.rest_framework.backends.DjangoFilterBackend'>,)
get_serializer_class()[source]

Don’t show the configuration in the list view.

permission_classes = [<class 'goat.views.GoatPermission'>]
queryset = <QuerySet [<Authority: VIAF>, <Authority: Conceptpower>, <Authority: GoatTest>]>
serializer_class

alias of AuthoritySerializer

suffix = None
class goat.views.ConceptViewSet(**kwargs)[source]

Bases: goat.views.CreateWithUserInfoMixin, rest_framework.viewsets.ModelViewSet

filter_backends = (<class 'django_filters.rest_framework.backends.DjangoFilterBackend'>,)
filter_class

alias of ConceptFilter

get_serializer_class()[source]
permission_classes = [<class 'goat.views.GoatPermission'>]
queryset = <QuerySet [<Concept: >, <Concept: Bradshaw Isherwood, Christopher William, 1904-1986>, <Concept: Bradshaw, John, 1933->, <Concept: Bradshaw, Paul F>, <Concept: Bradshaw, Henry, 1831-1886>, <Concept: Bradshaw, David, 1955->, <Concept: Bradshaw, Gillian, 1956->, <Concept: Bradshaw, Michael J. , 1935->, <Concept: Bradshaw, Tiny, 1905-1958>, <Concept: Bradshaw, Rita, 1950->, <Concept: Bradshaw, John, 1950->, <Concept: >, <Concept: Margaret Elizabeth Bradshaw>, <Concept: christopher william bradshaw isherwood>, <Concept: Anthony D. Bradshaw>, <Concept: Anthony David Bradshaw (1926-2008)>, <Concept: >, <Concept: >, <Concept: Bradshaw 1965>, <Concept: evolutionary biologist and author Richard Dawkins English ethologist>, '...(remaining elements truncated)...']>
serializer_class

alias of ConceptSerializer

suffix = None
class goat.views.CreateWithUserInfoMixin[source]

Bases: object

Extends the default ModelViewSet.create() to populate the added_by field.

create(request, *args, **kwargs)[source]
class goat.views.GoatPermission[source]

Bases: rest_framework.permissions.BasePermission

has_object_permission(request, view, obj)[source]
has_permission(request, view)[source]
class goat.views.IdentitySystemViewSet(**kwargs)[source]

Bases: goat.views.CreateWithUserInfoMixin, rest_framework.viewsets.ModelViewSet

create(request, *args, **kwargs)[source]

Populates the added_by field with the current user.

filter_backends = (<class 'django_filters.rest_framework.backends.DjangoFilterBackend'>,)
get_serializer_class()[source]
permission_classes = [<class 'goat.views.GoatPermission'>]
queryset = <QuerySet [<IdentitySystem: builtin:VIAF>, <IdentitySystem: builtin:Conceptpower>, <IdentitySystem: TestSystem>, <IdentitySystem: GoatTest>, <IdentitySystem: builtin:GoatTest>]>
serializer_class

alias of IdentitySystemSerializer

suffix = None
class goat.views.IdentityViewSet(**kwargs)[source]

Bases: rest_framework.viewsets.ModelViewSet

create(request, *args, **kwargs)[source]

Populates the added_by field with the current user, and checks that the user has change authorization on the IdentitySystem.

filter_backends = (<class 'django_filters.rest_framework.backends.DjangoFilterBackend'>,)
get_serializer_class()[source]
permission_classes = [<class 'goat.views.GoatPermission'>]
queryset = <QuerySet [<Identity: Anthony David Bradshaw (1926-2008)>, <Identity: asdf>, <Identity: fdsa>, <Identity: Anthony David Bradshaw (1926-2008)>, <Identity: Anthony David Bradshaw (1926-2008)>, <Identity: Anthony David Bradshaw (1926-2008)>, <Identity: Anthony David Bradshaw (1926-2008)>, <Identity: GoatTest>, <Identity: Anthony David Bradshaw (1926-2008)>, <Identity: Charles Darwin>, <Identity: Erasmus Darwin>, <Identity: Francis Darwin>, <Identity: Emma Darwin>, <Identity: Charles Darwin>, <Identity: Erasmus Darwin>, <Identity: Francis Darwin>, <Identity: Emma Darwin>, <Identity: Loeb>, <Identity: Jacques Loeb>, <Identity: Charles Darwin>, '...(remaining elements truncated)...']>
serializer_class

alias of IdentitySerializer

suffix = None
goat.views.home(request)[source]

Just a goat.

goat.views.identical(request)[source]

This provides a simpler view onto Identity instances than the IdentityViewSet. Here the client can pass an identifier and (optionally) an ID for a IdentitySystem instance, and get an array of identical Concepts.

goat.views.retrieve(request)[source]

Get a Concept by identifier.

goat.views.search(request)[source]

Trigger a search.

Since we may be searching quite a few authority systems, this view kicks off an asynchronous search strategy and forwards the client to the search status view.

TODO: should be able to filter the authorities used in the search.

goat.views.search_results(request, result_id)[source]

Check the status of a search.

goat.wsgi module

WSGI config for goat project.

It exposes the WSGI callable as a module-level variable named application.

For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/

Module contents