Revision 49433
Added by Alessia Bardi over 6 years ago
GCubeResourceRegistrator.java | ||
---|---|---|
152 | 152 |
Resource project = itOfferedBy.nextStatement().getResource(); |
153 | 153 |
ParthenosRegistryResource source = idMap.get(uri); |
154 | 154 |
ParthenosRegistryResource projectRes = idMap.get(project.getURI()); |
155 |
String relJson = relWriter.writeRelationship(jsonFactory, "PP1_currently_offers", projectRes.getUuid(), projectRes.getType(), source.getUuid(), source.getType());
|
|
155 |
String relJson = relWriter.writeRelationship(jsonFactory, "PP1_currently_offers", projectRes.getUuid(), projectRes.getRegistryType(), source.getUuid(), source.getRegistryType());
|
|
156 | 156 |
this.resourceRegistryPublisher.createIsRelatedTo("PP1_currently_offers", relJson); |
157 | 157 |
relCount++; |
158 | 158 |
} |
... | ... | |
161 | 161 |
Resource provider = itProvidedBy.nextStatement().getResource(); |
162 | 162 |
ParthenosRegistryResource prr = idMap.get(uri); |
163 | 163 |
ParthenosRegistryResource providerRes = idMap.get(provider.getURI()); |
164 |
String relJson = relWriter.writeRelationship(jsonFactory, "PP2_provided_by", prr.getUuid(), prr.getType(), providerRes.getUuid(), providerRes.getType());
|
|
164 |
String relJson = relWriter.writeRelationship(jsonFactory, "PP2_provided_by", prr.getUuid(), prr.getRegistryType(), providerRes.getUuid(), providerRes.getRegistryType());
|
|
165 | 165 |
this.resourceRegistryPublisher.createIsRelatedTo("PP2_provided_by", relJson); |
166 | 166 |
relCount++; |
167 | 167 |
//TODO: IsRelatedTo the contact person of the provider. Interpret '"Follow path of service ‘Provided by’ and switch E39 for E21: E21- >p76->E51"" |
... | ... | |
189 | 189 |
Resource obj = itPartOf.nextStatement().getResource(); |
190 | 190 |
ParthenosRegistryResource prr = idMap.get(uri); |
191 | 191 |
ParthenosRegistryResource objres = idMap.get(obj.getURI()); |
192 |
String relJson = relWriter.writeRelationship(jsonFactory, "PP23_has_dataset_part", objres.getUuid(), objres.getType(), prr.getUuid(), prr.getType());
|
|
192 |
String relJson = relWriter.writeRelationship(jsonFactory, "PP23_has_dataset_part", objres.getUuid(), objres.getRegistryType(), prr.getUuid(), prr.getRegistryType());
|
|
193 | 193 |
this.resourceRegistryPublisher.createIsRelatedTo("PP23_has_dataset_part", relJson); |
194 | 194 |
relCount++; |
195 | 195 |
} |
... | ... | |
200 | 200 |
if(obj.hasProperty(RDF.type, CRM.E55_Type)) { |
201 | 201 |
ParthenosRegistryResource prr = idMap.get(uri); |
202 | 202 |
ParthenosRegistryResource objres = idMap.get(obj.getURI()); |
203 |
String relJson = relWriter.writeRelationship(jsonFactory, "P129_is_about", prr.getUuid(), prr.getType(), objres.getUuid(), objres.getType());
|
|
203 |
String relJson = relWriter.writeRelationship(jsonFactory, "P129_is_about", prr.getUuid(), prr.getRegistryType(), objres.getUuid(), objres.getRegistryType());
|
|
204 | 204 |
this.resourceRegistryPublisher.createIsRelatedTo("P129_is_about", relJson); |
205 | 205 |
relCount++; |
206 | 206 |
} |
... | ... | |
249 | 249 |
if(obj == null) throw new ParthenosPublisherException(String.format("No target resource available for %s --> %s", subject.getURI(), rel.getURI())); |
250 | 250 |
ParthenosRegistryResource source = idMap.get(subject.getURI()); |
251 | 251 |
ParthenosRegistryResource target = idMap.get(obj.getURI()); |
252 |
String relJson = relWriter.writeRelationship(jsonFactory, rel.getLocalName(), source.getUuid(), source.getType(), target.getUuid(), target.getType());
|
|
252 |
String relJson = relWriter.writeRelationship(jsonFactory, rel.getLocalName(), source.getUuid(), source.getRegistryType(), target.getUuid(), target.getRegistryType());
|
|
253 | 253 |
this.resourceRegistryPublisher.createIsRelatedTo(rel.getLocalName(), relJson); |
254 | 254 |
relCount++; |
255 | 255 |
} |
... | ... | |
275 | 275 |
ParthenosRegistryResource prr = processService(res, jsonFactory, idMap); |
276 | 276 |
//TODO: if something goes wrong we stop the registration but we are not rolling back the one that may have succeeded before. |
277 | 277 |
//Let's decide if this is ok or if we must be smarter than this |
278 |
this.resourceRegistryPublisher.createResource(prr.getType(), prr.getJson()); |
|
278 |
this.resourceRegistryPublisher.createResource(prr.getRegistryType(), prr.getJson());
|
|
279 | 279 |
uriProcessed.add(resourceURI); |
280 | 280 |
idMap.put(resourceURI, prr); |
281 | 281 |
count++; |
... | ... | |
336 | 336 |
jg.writeObjectFieldStart("header"); |
337 | 337 |
jg.writeStringField("uuid", uuid); |
338 | 338 |
jg.writeEndObject(); |
339 |
jg.writeStringField("@class", className);
|
|
339 |
jg.writeStringField("@class", StringUtils.remove(className, '-'));
|
|
340 | 340 |
return uuid; |
341 | 341 |
} |
342 | 342 |
|
... | ... | |
364 | 364 |
String resourceURI = res.getURI(); |
365 | 365 |
if (!uriProcessed.contains(resourceURI)) { |
366 | 366 |
ParthenosRegistryResource prr = processDigitalObject(res, jsonFactory, idMap); |
367 |
this.resourceRegistryPublisher.createResource(prr.getType(), prr.getJson()); |
|
367 |
this.resourceRegistryPublisher.createResource(prr.getRegistryType(), prr.getJson());
|
|
368 | 368 |
uriProcessed.add(resourceURI); |
369 | 369 |
idMap.put(resourceURI, prr); |
370 | 370 |
count++; |
... | ... | |
458 | 458 |
String resourceURI = res.getURI(); |
459 | 459 |
if (!uriProcessed.contains(resourceURI)) { |
460 | 460 |
ParthenosRegistryResource prr = processProject(res, jsonFactory, idMap); |
461 |
this.resourceRegistryPublisher.createResource(prr.getType(), prr.getJson()); |
|
461 |
this.resourceRegistryPublisher.createResource(prr.getRegistryType(), prr.getJson());
|
|
462 | 462 |
uriProcessed.add(resourceURI); |
463 | 463 |
idMap.put(resourceURI, prr); |
464 | 464 |
count++; |
Also available in: Unified diff
no way the registry can handle '-'