# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2018-05-31 13:17
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import rdf_io.models


class Migration(migrations.Migration):

    dependencies = [
        ('rdf_io', '0002_auto_20170810_2351'),
    ]

    operations = [
        migrations.CreateModel(
            name='AttachedMetadata',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(max_length=2000, verbose_name='value')),
            ],
        ),
        migrations.CreateModel(
            name='ChainedMapping',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('attr', rdf_io.models.EXPR_Field(help_text='for a literal, use "quoted" syntax, for nested attribute use syntax a.b.c', max_length=400, verbose_name='source attribute')),
                ('predicate', rdf_io.models.CURIE_Field(help_text='use a:b or full URI', max_length=200, verbose_name='predicate')),
            ],
        ),
        migrations.CreateModel(
            name='ConfigVar',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('var', models.CharField(max_length=16, verbose_name='Variable name')),
                ('value', models.CharField(blank=True, max_length=255, verbose_name='Variable value')),
            ],
        ),
        migrations.CreateModel(
            name='ImportedResource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('resource_type', models.CharField(choices=[('RULE', 'Rule (SPIN, SHACL, SKWRL etc)'), ('CLASS', 'Class model - RDFS or OWL'), ('INSTANCE', 'Instance data - SKOS etc'), ('QUERY', 'Query template - SPARQL - for future use'), ('VALID', 'Validation rule - for future use')], default='INSTANCE', help_text='Determines the post processing applied to the uploaded file', max_length=10)),
                ('description', models.CharField(blank=True, max_length=255, verbose_name='ImportedResource Name')),
                ('file', models.FileField(blank=True, upload_to='resources/')),
                ('remote', models.URLField(blank=True, max_length=2000, verbose_name='Remote RDF source URI')),
                ('graph', models.URLField(blank=True, max_length=2000, null=True, verbose_name='Target RDF graph name')),
                ('uploaded_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='ServiceBinding',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(default='', max_length=255)),
                ('description', models.TextField(blank=True, max_length=1000, null=True)),
                ('binding_type', models.CharField(choices=[('VALIDATION', 'VALIDATION - Performs validation check'), ('INFERENCE', 'INFERENCE - The entailed response replaces the default encoding in downstream services'), ('PERSIST_CREATE', 'PERSIST_CREATE - A new resource is created only if not present in the persistence store'), ('PERSIST_REPLACE', 'PERSIST_REPLACE - (e.g. HTTP PUT) The resource and its properties are replaced in the persistence store'), ('PERSIST_UPDATE', 'PERSIST_UPDATE - (e.g. HTTP POST) The resource and its properties are added to the persistence store'), ('PERSIST_PURGE', 'PERSIST_PURGE - (e.g. HTTP DELETE) The resource and its properties are deleted from the persistence store')], default='PERSIST_REPLACE', help_text='Choose the role of service', max_length=16)),
                ('service_api', models.CharField(choices=[('RDF4JREST', 'RDF4JREST - a.k.a Sesame'), ('LDP', 'LDP: Linked Data Platform'), ('GIT', 'GIT'), ('SHACLAPI', 'SHACL service'), ('SPARQL', 'SPARQL endpoint')], help_text='Choose the API type of service', max_length=16)),
                ('service_url', models.CharField(help_text='Parameterised service url - {var} where var is an attribute of the object type being mapped (including django nested attributes using a__b syntax) or $model for the short model name', max_length=1000, verbose_name='service url template')),
                ('resource', models.CharField(default='/statements?context=<uri>', help_text='Parameterised path to target resource to be persisted - using the target service API syntax - e.g. /statements?context=<{uri}> for a RDF4J named graph.', max_length=1000, verbose_name='resource path')),
                ('inferenced_resource', models.CharField(blank=True, help_text='Parameterised path to intermediate resource - using the target service API syntax.  If this is an inferencing service then this will be the resource identifier for the additional triples generated by the inferencing rules generated for the specific object.', max_length=1000, null=True, verbose_name='generated resource')),
                ('object_filter', models.TextField(blank=True, help_text='A (python dict) filter on the objects that this binding applies to', max_length=2000, null=True, verbose_name='filter expression')),
                ('next_service', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='rdf_io.ServiceBinding', verbose_name='Next service')),
            ],
        ),
        migrations.AddField(
            model_name='genericmetaprop',
            name='uri',
            field=rdf_io.models.CURIE_Field(blank=True, help_text='use a:b or full URI', max_length=200),
        ),
        migrations.AlterField(
            model_name='genericmetaprop',
            name='namespace',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='rdf_io.Namespace', verbose_name='namespace'),
        ),
        migrations.AlterField(
            model_name='genericmetaprop',
            name='propname',
            field=models.CharField(blank=True, max_length=250, verbose_name='name'),
        ),
        migrations.AlterField(
            model_name='namespace',
            name='prefix',
            field=models.CharField(max_length=8, unique=True, verbose_name='prefix'),
        ),
        migrations.AlterField(
            model_name='namespace',
            name='uri',
            field=models.CharField(max_length=100, unique=True, verbose_name='uri'),
        ),
        migrations.AlterField(
            model_name='objectmapping',
            name='obj_type',
            field=models.ManyToManyField(help_text='set this to generate a object rdf:type X statement', to='rdf_io.ObjectType'),
        ),
        migrations.AddField(
            model_name='servicebinding',
            name='object_mapping',
            field=models.ManyToManyField(blank=True, to='rdf_io.ObjectMapping', verbose_name='Object mappings service binding applies to automatically'),
        ),
        migrations.AddField(
            model_name='servicebinding',
            name='on_delete_service',
            field=models.ForeignKey(blank=True, help_text='This will be invoked on object deletion if specified, and also if the binding is "replace" - which allows for a specific pre-deletion step if not supported by the repository API natively', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='on_delete', to='rdf_io.ServiceBinding', verbose_name='Deletion service'),
        ),
        migrations.AddField(
            model_name='servicebinding',
            name='on_fail_service',
            field=models.ForeignKey(blank=True, help_text='Overrides default failure reporting', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='on_fail', to='rdf_io.ServiceBinding', verbose_name='On fail service'),
        ),
        migrations.AddField(
            model_name='importedresource',
            name='target_repo',
            field=models.ForeignKey(blank=True, help_text='choose binding to optional RDF repository', null=True, on_delete=django.db.models.deletion.CASCADE, to='rdf_io.ServiceBinding'),
        ),
        migrations.AddField(
            model_name='chainedmapping',
            name='chainedMapping',
            field=models.ForeignKey(help_text='Mapping to nest, for each value of attribute. may be recursive', on_delete=django.db.models.deletion.CASCADE, related_name='chained', to='rdf_io.ObjectMapping'),
        ),
        migrations.AddField(
            model_name='chainedmapping',
            name='scope',
            field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='rdf_io.ObjectMapping'),
        ),
        migrations.AddField(
            model_name='attachedmetadata',
            name='metaprop',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rdf_io.GenericMetaProp', verbose_name='property'),
        ),
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2018-05-31 13:17
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import rdf_io.models


class Migration(migrations.Migration):

    dependencies = [
        ('rdf_io', '0002_auto_20170810_2351'),
    ]

    operations = [
        migrations.CreateModel(
            name='AttachedMetadata',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(max_length=2000, verbose_name='value')),
            ],
        ),
        migrations.CreateModel(
            name='ChainedMapping',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('attr', rdf_io.models.EXPR_Field(help_text='for a literal, use "quoted" syntax, for nested attribute use syntax a.b.c', max_length=400, verbose_name='source attribute')),
                ('predicate', rdf_io.models.CURIE_Field(help_text='use a:b or full URI', max_length=200, verbose_name='predicate')),
            ],
        ),
        migrations.CreateModel(
            name='ConfigVar',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('var', models.CharField(max_length=16, verbose_name='Variable name')),
                ('value', models.CharField(blank=True, max_length=255, verbose_name='Variable value')),
            ],
        ),
        migrations.CreateModel(
            name='ImportedResource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('resource_type', models.CharField(choices=[('RULE', 'Rule (SPIN, SHACL, SKWRL etc)'), ('CLASS', 'Class model - RDFS or OWL'), ('INSTANCE', 'Instance data - SKOS etc'), ('QUERY', 'Query template - SPARQL - for future use'), ('VALID', 'Validation rule - for future use')], default='INSTANCE', help_text='Determines the post processing applied to the uploaded file', max_length=10)),
                ('description', models.CharField(blank=True, max_length=255, verbose_name='ImportedResource Name')),
                ('file', models.FileField(blank=True, upload_to='resources/')),
                ('remote', models.URLField(blank=True, max_length=2000, verbose_name='Remote RDF source URI')),
                ('graph', models.URLField(blank=True, max_length=2000, null=True, verbose_name='Target RDF graph name')),
                ('uploaded_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='ServiceBinding',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(default='', max_length=255)),
                ('description', models.TextField(blank=True, max_length=1000, null=True)),
                ('binding_type', models.CharField(choices=[('VALIDATION', 'VALIDATION - Performs validation check'), ('INFERENCE', 'INFERENCE - The entailed response replaces the default encoding in downstream services'), ('PERSIST_CREATE', 'PERSIST_CREATE - A new resource is created only if not present in the persistence store'), ('PERSIST_REPLACE', 'PERSIST_REPLACE - (e.g. HTTP PUT) The resource and its properties are replaced in the persistence store'), ('PERSIST_UPDATE', 'PERSIST_UPDATE - (e.g. HTTP POST) The resource and its properties are added to the persistence store'), ('PERSIST_PURGE', 'PERSIST_PURGE - (e.g. HTTP DELETE) The resource and its properties are deleted from the persistence store')], default='PERSIST_REPLACE', help_text='Choose the role of service', max_length=16)),
                ('service_api', models.CharField(choices=[('RDF4JREST', 'RDF4JREST - a.k.a Sesame'), ('LDP', 'LDP: Linked Data Platform'), ('GIT', 'GIT'), ('SHACLAPI', 'SHACL service'), ('SPARQL', 'SPARQL endpoint')], help_text='Choose the API type of service', max_length=16)),
                ('service_url', models.CharField(help_text='Parameterised service url - {var} where var is an attribute of the object type being mapped (including django nested attributes using a__b syntax) or $model for the short model name', max_length=1000, verbose_name='service url template')),
                ('resource', models.CharField(default='/statements?context=<uri>', help_text='Parameterised path to target resource to be persisted - using the target service API syntax - e.g. /statements?context=<{uri}> for a RDF4J named graph.', max_length=1000, verbose_name='resource path')),
                ('inferenced_resource', models.CharField(blank=True, help_text='Parameterised path to intermediate resource - using the target service API syntax.  If this is an inferencing service then this will be the resource identifier for the additional triples generated by the inferencing rules generated for the specific object.', max_length=1000, null=True, verbose_name='generated resource')),
                ('object_filter', models.TextField(blank=True, help_text='A (python dict) filter on the objects that this binding applies to', max_length=2000, null=True, verbose_name='filter expression')),
                ('next_service', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='rdf_io.ServiceBinding', verbose_name='Next service')),
            ],
        ),
        migrations.AddField(
            model_name='genericmetaprop',
            name='uri',
            field=rdf_io.models.CURIE_Field(blank=True, help_text='use a:b or full URI', max_length=200),
        ),
        migrations.AlterField(
            model_name='genericmetaprop',
            name='namespace',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='rdf_io.Namespace', verbose_name='namespace'),
        ),
        migrations.AlterField(
            model_name='genericmetaprop',
            name='propname',
            field=models.CharField(blank=True, max_length=250, verbose_name='name'),
        ),
        migrations.AlterField(
            model_name='namespace',
            name='prefix',
            field=models.CharField(max_length=8, unique=True, verbose_name='prefix'),
        ),
        migrations.AlterField(
            model_name='namespace',
            name='uri',
            field=models.CharField(max_length=100, unique=True, verbose_name='uri'),
        ),
        migrations.AlterField(
            model_name='objectmapping',
            name='obj_type',
            field=models.ManyToManyField(help_text='set this to generate a object rdf:type X statement', to='rdf_io.ObjectType'),
        ),
        migrations.AddField(
            model_name='servicebinding',
            name='object_mapping',
            field=models.ManyToManyField(blank=True, to='rdf_io.ObjectMapping', verbose_name='Object mappings service binding applies to automatically'),
        ),
        migrations.AddField(
            model_name='servicebinding',
            name='on_delete_service',
            field=models.ForeignKey(blank=True, help_text='This will be invoked on object deletion if specified, and also if the binding is "replace" - which allows for a specific pre-deletion step if not supported by the repository API natively', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='on_delete', to='rdf_io.ServiceBinding', verbose_name='Deletion service'),
        ),
        migrations.AddField(
            model_name='servicebinding',
            name='on_fail_service',
            field=models.ForeignKey(blank=True, help_text='Overrides default failure reporting', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='on_fail', to='rdf_io.ServiceBinding', verbose_name='On fail service'),
        ),
        migrations.AddField(
            model_name='importedresource',
            name='target_repo',
            field=models.ForeignKey(blank=True, help_text='choose binding to optional RDF repository', null=True, on_delete=django.db.models.deletion.CASCADE, to='rdf_io.ServiceBinding'),
        ),
        migrations.AddField(
            model_name='chainedmapping',
            name='chainedMapping',
            field=models.ForeignKey(help_text='Mapping to nest, for each value of attribute. may be recursive', on_delete=django.db.models.deletion.CASCADE, related_name='chained', to='rdf_io.ObjectMapping'),
        ),
        migrations.AddField(
            model_name='chainedmapping',
            name='scope',
            field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='rdf_io.ObjectMapping'),
        ),
        migrations.AddField(
            model_name='attachedmetadata',
            name='metaprop',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rdf_io.GenericMetaProp', verbose_name='property'),
        ),
    ]

# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2018-05-31 13:17