-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsdoterm.py
executable file
·102 lines (67 loc) · 2.29 KB
/
sdoterm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import logging
logging.basicConfig(level=logging.INFO) # dev_appserver.py --log_level debug .
log = logging.getLogger(__name__)
#from testharness import *
import rdflib
from rdflib import URIRef
import io
VOCABURI="https://schema.org/"
class SdoTerm():
TYPE = "Type"
PROPERTY = "Property"
DATATYPE = "Datatype"
ENUMERATION = "Enumeration"
ENUMERATIONVALUE = "Enumerationvalue"
REFERENCE = "Reference"
def __init__(self,termType,Id,uri,label):
self.expanded = False
self.termType = termType
self.uri = uri
self.id = Id
self.label = label
self.acknowledgements = []
self.superPaths = []
self.comment = ""
self.equivalents = []
self.examples = []
self.pending = False
self.retired = False
self.sources = []
self.subs = []
self.supers = []
self.supersededBy = ""
self.supersedes = ""
self.termStack = []
class SdoType(SdoTerm):
def __init__(self,Id,uri,label):
SdoTerm.__init__(self,SdoTerm.TYPE,Id,uri,label)
self.properties = []
self.allproperties = []
self.expectedTypeFor = []
class SdoProperty(SdoTerm):
def __init__(self,Id,uri,label):
SdoTerm.__init__(self,SdoTerm.PROPERTY,Id,uri,label)
self.domainIncludes = []
self.rangeIncludes = []
class SdoDataType(SdoTerm):
def __init__(self,Id,uri,label):
SdoTerm.__init__(self,SdoTerm.DATATYPE,Id,uri,label)
self.properties = []
self.allproperties = []
self.expectedTypeFor = []
class SdoEnumeration(SdoTerm):
def __init__(self,Id,uri,label):
SdoTerm.__init__(self,SdoTerm.ENUMERATION,Id,uri,label)
self.properties = []
self.allproperties = []
self.expectedTypeFor = []
self.enumerationMembers = []
class SdoEnumerationvalue(SdoTerm):
def __init__(self,Id,uri,label):
SdoTerm.__init__(self,SdoTerm.ENUMERATIONVALUE,Id,uri,label)
self.enumerationParent = ""
class SdoReference(SdoTerm):
def __init__(self,Id,uri,label):
SdoTerm.__init__(self,SdoTerm.REFERENCE,Id,uri,label)