equal
deleted
inserted
replaced
|
1 from django.conf import settings |
|
2 import base64 |
|
3 import django.core.urlresolvers |
|
4 import lxml.etree |
|
5 import urllib |
1 import uuid |
6 import uuid |
2 import django.core.urlresolvers |
|
3 from django.conf import settings |
|
4 from ldt.text.models import * |
|
5 import urllib |
|
6 import datetime |
|
7 import lxml.etree |
|
8 import base64 |
|
9 |
7 |
10 __BOOLEAN_DICT = { |
8 __BOOLEAN_DICT = { |
11 'false':False, |
9 'false':False, |
12 'true':True, |
10 'true':True, |
13 '0':False, |
11 '0':False, |
36 nlist.append(tag) |
34 nlist.append(tag) |
37 taglist = dict().fromkeys(nlist).keys() |
35 taglist = dict().fromkeys(nlist).keys() |
38 |
36 |
39 return taglist |
37 return taglist |
40 |
38 |
41 |
|
42 def create_empty_annotation(): |
|
43 iri = lxml.etree.Element('iri') |
|
44 doc = lxml.etree.ElementTree(iri) |
|
45 |
|
46 textannotation = lxml.etree.SubElement(iri, 'text-annotation') |
|
47 id = lxml.etree.SubElement(textannotation,'id') |
|
48 uri = lxml.etree.SubElement(textannotation,'uri') |
|
49 tags = lxml.etree.SubElement(textannotation,'tags') |
|
50 |
|
51 content = lxml.etree.SubElement(textannotation,'content') |
|
52 color = lxml.etree.SubElement(content,'color') |
|
53 description = lxml.etree.SubElement(content,'description') |
|
54 title = lxml.etree.SubElement(content,'title') |
|
55 text = lxml.etree.SubElement(content,'text') |
|
56 |
|
57 meta = lxml.etree.SubElement(textannotation,'meta') |
|
58 contributor = lxml.etree.SubElement(meta, "contributor") |
|
59 creator = lxml.etree.SubElement(meta, "creator") |
|
60 creationdate = lxml.etree.SubElement(meta, "created") |
|
61 updatedate = lxml.etree.SubElement(meta, "modified") |
|
62 |
|
63 return doc |
|
64 |
|