|
38 | 38 | LOADEDDEFAULT = False |
39 | 39 |
|
40 | 40 |
|
| 41 | +def bindNameSpaces(graph): |
| 42 | + # --- Standard / W3C / Dublin Core --- |
| 43 | + graph.bind("dc", "http://purl.org/dc/elements/1.1/") |
| 44 | + graph.bind("dcat", "http://www.w3.org/ns/dcat#") |
| 45 | + graph.bind("dct", "http://purl.org/dc/terms/") |
| 46 | + graph.bind("dctype", "http://purl.org/dc/dcmitype/") |
| 47 | + graph.bind("foaf", "http://xmlns.com/foaf/0.1/") |
| 48 | + graph.bind("owl", "http://www.w3.org/2002/07/owl#") |
| 49 | + graph.bind("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#") |
| 50 | + graph.bind("rdfs", "http://www.w3.org/2000/01/rdf-schema#") |
| 51 | + graph.bind("skos", "http://www.w3.org/2004/02/skos/core#") |
| 52 | + graph.bind("void", "http://rdfs.org/ns/void#") |
| 53 | + |
| 54 | + # --- OMG Commons --- |
| 55 | + graph.bind("cmns-cls", "https://www.omg.org/spec/Commons/Classifiers/") |
| 56 | + graph.bind("cmns-col", "https://www.omg.org/spec/Commons/Collections/") |
| 57 | + graph.bind("cmns-dt", "https://www.omg.org/spec/Commons/DatesAndTimes/") |
| 58 | + graph.bind("cmns-ge", "https://www.omg.org/spec/Commons/GeopoliticalEntities/") |
| 59 | + graph.bind("cmns-id", "https://www.omg.org/spec/Commons/Identifiers/") |
| 60 | + graph.bind("cmns-loc", "https://www.omg.org/spec/Commons/Locations/") |
| 61 | + graph.bind("cmns-q", "https://www.omg.org/spec/Commons/Quantities/") |
| 62 | + graph.bind("cmns-txt", "https://www.omg.org/spec/Commons/Text/") |
| 63 | + |
| 64 | + # --- OMG LCC (ISO Codes) --- |
| 65 | + graph.bind( |
| 66 | + "lcc-3166-1", "https://www.omg.org/spec/LCC/Countries/ISO3166-1-CountryCodes/" |
| 67 | + ) |
| 68 | + graph.bind( |
| 69 | + "lcc-4217", "https://www.omg.org/spec/LCC/Countries/ISO4217-CurrencyCodes/" |
| 70 | + ) |
| 71 | + graph.bind( |
| 72 | + "lcc-lr", "https://www.omg.org/spec/LCC/Languages/LanguageRepresentation/" |
| 73 | + ) |
| 74 | + |
| 75 | + # --- FIBO (Financial Industry Business Ontology) --- |
| 76 | + graph.bind( |
| 77 | + "fibo-be-corp-corp", |
| 78 | + "https://spec.edmcouncil.org/fibo/ontology/BE/Corporations/Corporations/", |
| 79 | + ) |
| 80 | + graph.bind( |
| 81 | + "fibo-be-ge-ge", |
| 82 | + "https://spec.edmcouncil.org/fibo/ontology/BE/GovernmentEntities/GovernmentEntities/", |
| 83 | + ) |
| 84 | + graph.bind( |
| 85 | + "fibo-be-le-cb", |
| 86 | + "https://spec.edmcouncil.org/fibo/ontology/BE/LegalEntities/CorporateBodies/", |
| 87 | + ) |
| 88 | + graph.bind( |
| 89 | + "fibo-be-le-lp", |
| 90 | + "https://spec.edmcouncil.org/fibo/ontology/BE/LegalEntities/LegalPersons/", |
| 91 | + ) |
| 92 | + graph.bind( |
| 93 | + "fibo-be-nfp-nfp", |
| 94 | + "https://spec.edmcouncil.org/fibo/ontology/BE/NotForProfitOrganizations/NotForProfitOrganizations/", |
| 95 | + ) |
| 96 | + graph.bind( |
| 97 | + "fibo-be-oac-cctl", |
| 98 | + "https://spec.edmcouncil.org/fibo/ontology/BE/OwnershipAndControl/CorporateControl/", |
| 99 | + ) |
| 100 | + graph.bind( |
| 101 | + "fibo-fbc-dae-dbt", |
| 102 | + "https://spec.edmcouncil.org/fibo/ontology/FBC/DebtAndEquities/Debt/", |
| 103 | + ) |
| 104 | + graph.bind( |
| 105 | + "fibo-fbc-pas-fpas", |
| 106 | + "https://spec.edmcouncil.org/fibo/ontology/FBC/ProductsAndServices/FinancialProductsAndServices/", |
| 107 | + ) |
| 108 | + graph.bind( |
| 109 | + "fibo-fnd-acc-cur", |
| 110 | + "https://spec.edmcouncil.org/fibo/ontology/FND/Accounting/CurrencyAmount/", |
| 111 | + ) |
| 112 | + graph.bind( |
| 113 | + "fibo-fnd-agr-ctr", |
| 114 | + "https://spec.edmcouncil.org/fibo/ontology/FND/Agreements/Contracts/", |
| 115 | + ) |
| 116 | + graph.bind( |
| 117 | + "fibo-fnd-arr-doc", |
| 118 | + "https://spec.edmcouncil.org/fibo/ontology/FND/Arrangements/Documents/", |
| 119 | + ) |
| 120 | + graph.bind( |
| 121 | + "fibo-fnd-arr-lif", |
| 122 | + "https://spec.edmcouncil.org/fibo/ontology/FND/Arrangements/Lifecycles/", |
| 123 | + ) |
| 124 | + graph.bind( |
| 125 | + "fibo-fnd-dt-oc", |
| 126 | + "https://spec.edmcouncil.org/fibo/ontology/FND/DatesAndTimes/Occurrences/", |
| 127 | + ) |
| 128 | + graph.bind( |
| 129 | + "fibo-fnd-org-org", |
| 130 | + "https://spec.edmcouncil.org/fibo/ontology/FND/Organizations/Organizations/", |
| 131 | + ) |
| 132 | + graph.bind( |
| 133 | + "fibo-fnd-pas-pas", |
| 134 | + "https://spec.edmcouncil.org/fibo/ontology/FND/ProductsAndServices/ProductsAndServices/", |
| 135 | + ) |
| 136 | + graph.bind( |
| 137 | + "fibo-fnd-plc-adr", |
| 138 | + "https://spec.edmcouncil.org/fibo/ontology/FND/Places/Addresses/", |
| 139 | + ) |
| 140 | + graph.bind( |
| 141 | + "fibo-fnd-plc-fac", |
| 142 | + "https://spec.edmcouncil.org/fibo/ontology/FND/Places/Facilities/", |
| 143 | + ) |
| 144 | + graph.bind( |
| 145 | + "fibo-fnd-plc-loc", |
| 146 | + "https://spec.edmcouncil.org/fibo/ontology/FND/Places/Locations/", |
| 147 | + ) |
| 148 | + graph.bind( |
| 149 | + "fibo-fnd-pty-pty", |
| 150 | + "https://spec.edmcouncil.org/fibo/ontology/FND/Parties/Parties/", |
| 151 | + ) |
| 152 | + graph.bind( |
| 153 | + "fibo-fnd-rel-rel", |
| 154 | + "https://spec.edmcouncil.org/fibo/ontology/FND/Relations/Relations/", |
| 155 | + ) |
| 156 | + graph.bind( |
| 157 | + "fibo-pay-ps-ps", |
| 158 | + "https://spec.edmcouncil.org/fibo/ontology/PAY/PaymentServices/PaymentServices/", |
| 159 | + ) |
| 160 | + |
| 161 | + # --- Other External Vocabularies --- |
| 162 | + graph.bind("gleif-L1", "https://www.gleif.org/ontology/L1/") |
| 163 | + graph.bind("gs1", "https://ref.gs1.org/voc/") |
| 164 | + graph.bind( |
| 165 | + "lcc-cr", "https://www.omg.org/spec/LCC/Countries/CountryRepresentation/" |
| 166 | + ) |
| 167 | + graph.bind("unece", "http://unece.org/vocab#") |
| 168 | + graph.bind("vcard", "http://www.w3.org/2006/vcard/ns#") |
| 169 | + graph.bind("bibo", "http://purl.org/ontology/bibo/") |
| 170 | + graph.bind("sarif", "http://sarif.info/") |
| 171 | + |
| 172 | + # --- Libraries and Health --- |
| 173 | + graph.bind("lrmoo", "http://iflastandards.info/ns/lrm/lrmoo/") |
| 174 | + graph.bind("snomed", "http://purl.bioontology.org/ontology/SNOMEDCT/") |
| 175 | + |
| 176 | + # --- European Legislation Identifier (ELI) --- |
| 177 | + graph.bind("eli", "http://data.europa.eu/eli/ontology#") |
| 178 | + |
| 179 | + # --- W3C Standard extensions --- |
| 180 | + graph.bind("prov", "http://www.w3.org/ns/prov#") |
| 181 | + graph.bind("hydra", "http://www.w3.org/ns/hydra/core#") |
| 182 | + |
| 183 | + # --- Music Ontology --- |
| 184 | + graph.bind("mo", "http://purl.org/ontology/mo/") |
| 185 | + |
| 186 | + |
41 | 187 | class _TermAccumulator: |
42 | 188 | """Temporary holder to accumulate term information.""" |
43 | 189 |
|
@@ -313,9 +459,9 @@ def getAcknowledgements(self) -> typing.Sequence[str]: |
313 | 459 | ) # To accept later ttl versions. |
314 | 460 | for obj in objs: |
315 | 461 | if obj: |
316 | | - cont = sdocollaborators.collaborator.getContributor(obj) |
317 | | - if cont: |
318 | | - acks.append(cont) |
| 462 | + cont = sdocollaborators.collaborator.getContributor(obj) |
| 463 | + if cont: |
| 464 | + acks.append(cont) |
319 | 465 | self.acks = sorted(acks, key=lambda t: t.title) |
320 | 466 | return self.acks |
321 | 467 |
|
@@ -954,12 +1100,7 @@ def setSourceGraph(cls, g: rdflib.graph.Graph): |
954 | 1100 | global VOCABURI |
955 | 1101 | cls.SOURCEGRAPH = g |
956 | 1102 | g.bind("schema", VOCABURI) |
957 | | - g.bind("owl", "http://www.w3.org/2002/07/owl#") |
958 | | - g.bind("dc", "http://purl.org/dc/elements/1.1/") |
959 | | - g.bind("dct", "http://purl.org/dc/terms/") |
960 | | - g.bind("dctype", "http://purl.org/dc/dcmitype/") |
961 | | - g.bind("void", "http://rdfs.org/ns/void#") |
962 | | - g.bind("dcat", "http://www.w3.org/ns/dcat#") |
| 1103 | + bindNameSpaces(g) |
963 | 1104 |
|
964 | 1105 | cls.TERMS = {} # Clear cache |
965 | 1106 | cls.EXPANDEDTERMS = {} |
|
0 commit comments