diff --git a/apps/zoon/models.py b/apps/zoon/models.py index fae7d37..a96fd7d 100644 --- a/apps/zoon/models.py +++ b/apps/zoon/models.py @@ -15,6 +15,7 @@ class ZooniverseWorkflow(models.Model): + '''The main shell that keeps each project separate from others. Generally, each county will require a separate ZooniverseWorkflow object.''' zoon_id = models.IntegerField(null=True, blank=True, db_index=True) workflow_name = models.CharField(max_length=100, db_index=True) # version = models.FloatField(null=True, blank=True) @@ -156,7 +157,7 @@ def get_queryset(self): class ZooniverseSubject(models.Model): - '''Future: Assign an id to correspond to a deed image pre-Zooniverse''' + '''This is the main model representing an individual suspected covenant coming back from Zooniverse transcription. Each subject should have five individual transcription responses, which will be aggregated to be displayed with each ZooniverseSubject. Possible future task: Assign an id to correspond to a deed image pre-Zooniverse''' workflow = models.ForeignKey(ZooniverseWorkflow, on_delete=models.CASCADE) zoon_subject_id = models.IntegerField(db_index=True) @@ -419,6 +420,7 @@ def save(self, *args, **kwargs): class ZooniverseResponseRaw(models.Model): + '''Information imported after Zooniverse transcription in its natural state after Zooniverse's panoptes-aggregation scripts. Most useful data is still contained inside annotations and subject_data fields, which will be further processed to produce a ZooniverseResponseProcessed.''' classification_id = models.IntegerField() user_name = models.CharField(max_length=100, blank=True, db_index=True) user_id = models.IntegerField(null=True) @@ -443,6 +445,7 @@ class ZooniverseResponseRaw(models.Model): class ZooniverseResponseProcessed(models.Model): + '''Information about an individual transcription that will show up under a ZooniverseSubject during manual review. A more fully processed version of ZooniverseResponseRaw.''' workflow = models.ForeignKey(ZooniverseWorkflow, on_delete=models.CASCADE) classification_id = models.IntegerField() user_name = models.CharField(max_length=100, blank=True, db_index=True) @@ -772,6 +775,7 @@ def manual_cov_post_save(sender, instance=None, created=False, **kwargs): class ManualSupportingDocument(models.Model): + '''An uploaded document that provides evidence of a racial covenant, which is attached to a ManualCovenant object.''' workflow = models.ForeignKey( ZooniverseWorkflow, on_delete=models.CASCADE, null=True) manual_covenant = models.ForeignKey(ManualCovenant, on_delete=models.CASCADE) diff --git a/docs/index.rst b/docs/index.rst index b43cd65..f14314d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -41,6 +41,7 @@ The Deed Machine was created at Mapping Prejudice at the University of Minnesota modules/uploading-files.rst modules/ingesting-hits.rst modules/uploading-to-zooniverse.rst + modules/uploading-parcel-data.rst modules/downloading-new-results.rst modules/manual-data-cleaning.rst @@ -49,7 +50,9 @@ The Deed Machine was created at Mapping Prejudice at the University of Minnesota :maxdepth: 2 :caption: Models + modules/django-models.rst modules/apps-deed-models.rst + modules/apps-zoon-models.rst Indices and tables ================== diff --git a/docs/modules/apps-zoon-models.rst b/docs/modules/apps-zoon-models.rst new file mode 100644 index 0000000..195ac6d --- /dev/null +++ b/docs/modules/apps-zoon-models.rst @@ -0,0 +1,4 @@ +apps.zoon.models.py +=================== +.. automodule:: apps.zoon.models + :members: diff --git a/docs/modules/django-models.rst b/docs/modules/django-models.rst new file mode 100644 index 0000000..d88b010 --- /dev/null +++ b/docs/modules/django-models.rst @@ -0,0 +1,114 @@ +Django model structure +====================== + +Core concepts +------------- + +The Django component of the Deed Machine is divided up into apps, and within each app, models. + +The four Django apps are ``deed``, ``parcel``, ``plat``, and ``zoon``. + +Main models that end users will interact with: +:: + + racial_covenants_processor + ├── apps + ├── deed + ├── DeedPage + ├── parcel + ├── Parcel + ├── ParcelJoinCandidate + ├── ShpExport/CSVExport/GeoJSONExport + ├── UnmappedCSVExport + ├── AllCovenantedDocsCSVExport + ├── plat + ├── Plat + ├── PlatAlternateName + ├── Subdivision + ├── SubdivisionAlternateName + ├── zoon + ├── ZooniverseWorkflow + ├── ZooniverseSubject + ├── ManualCorrection + ├── ExtraParcelCandidate + ├── ManualCovenant + ├── ManualSupportingDocument + + +The Deed app +------------ + +The Deed app houses information about historical property record images provided by records custodians to be searched for racial covenants. + +After :ref:`_initial-processing`, management commands in the Deed app ingest metadata about these raw documents and whether or not they have been identified as potential racial covenants (i.e. the "hits") into the Django/postgresql database. + +See :ref:`_ingesting-hits` for more about this process. + +The Parcel app +-------------- + +The Parcel app is used to house information about modern, GIS-enabled property records, which are used to map historical racial covenants. The Deed Machine uses transcribed information about each historical covenant to try to link the addition, block and lot of each covenant to matching information in modern parcel records stored in the Parcel app. The Parcel app is populated by uploading parcel shapefiles into the GeoDjango Parcel model, with or without preprocessing. + +See :ref:`_uploading-parcel-data`. + +Mapping Prejudice counts racial covenants by identifying the earliest racial covenant document that is associated with a modern property. Thus, each row in Mapping Prejudice's covenants exports represents one modern property, as opposed to each row representing one document, as the same racial covenant was often repeated in subsequent sales of the same property. + +Logic for aggregation and export of racial covenants is mostly contained in the Parcel app through the CovenantsParcelManager. + +The Plat app +------------ + +The Plat app is used to organize information about historical plat or modern subdivision records provided by records custodians or county GIS offices. By uploading information about plats/subdivisions and by adding alternative spellings of plat/subdivision names, users can generate additional join candidates that may help to map covenants with unusual spelling variations in their addition names. + +Though they are somewhat interchangeable terms in the larger property world, in the Deed Machine, the Plat model is for historical plat maps, while the Subdivision model is for modern, GIS-enabled data, which is more likely to be available, and can be used to spatially associate Parcel records with additional subdivision names. + +The Zoon app +------------ + +The Zoon app contains information related to Zooniverse transcription, including uploading of hits to zooniverse, and the processing of data coming back from Zooniverse Transcription. + +Manual correction work is done by browsing the ZooniverseSubject list, using a combination of ManualCorrection and ExtraParcelCandidate objects that are generated by manual edits. + +Covenants entered manually (not through Zooniverse transcription) are stored in the ManualCovenant model of the Zoon app. + +Full list of Apps/Models +------------------------ + +:: + + racial_covenants_processor + ├── apps + ├── deed + ├── DeedPage + ├── SearchHitReport + ├── parcel + ├── Parcel + ├── ParcelJoinCandidate + ├── JoinReport + ├── ShpExport + ├── CSVExport + ├── UnmappedCSVExport + ├── ValidationCSVExport + ├── AllCovenantedDocsCSVExport + ├── GeoJSONExport + ├── plat + ├── Plat + ├── PlatMapPage + ├── PlatAlternateName + ├── Subdivision + ├── SubdivisionAlternateName + ├── zoon + ├── ZooniverseWorkflow + ├── UnmappedZooniverseManager + ├── AllCovenantedDocsZooniverseManager + ├── ValidationZooniverseManager + ├── ZooniverseSubject + ├── ZooniverseResponseRaw + ├── ZooniverseResponseProcessed + ├── ZooniverseUser + ├── ReducedResponse_Question + ├── ReducedResponse_Text + ├── ManualCorrection + ├── ExtraParcelCandidate + ├── ManualCovenant + ├── ManualSupportingDocument \ No newline at end of file diff --git a/docs/modules/uploading-files.rst b/docs/modules/uploading-files.rst index 9bd933c..1d5be03 100644 --- a/docs/modules/uploading-files.rst +++ b/docs/modules/uploading-files.rst @@ -1,3 +1,5 @@ +.. _initial-processing: + Uploading images/initial processing =================================== diff --git a/docs/modules/uploading-parcel-data.rst b/docs/modules/uploading-parcel-data.rst new file mode 100644 index 0000000..012315d --- /dev/null +++ b/docs/modules/uploading-parcel-data.rst @@ -0,0 +1,9 @@ +.. _uploading-parcel-data: + +Uploading modern parcel data for mapping +======================================== + +TK TK TK +--------- + +TK. \ No newline at end of file