Revision 51390
Added by Alessia Bardi over 6 years ago
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/catalogue/CatalogueRegistrator.java | ||
---|---|---|
31 | 31 |
public class CatalogueRegistrator { |
32 | 32 |
|
33 | 33 |
private static final Log log = LogFactory.getLog(CatalogueRegistrator.class); |
34 |
private final String PARTHENOS_BASE_URL = "http://parthenos.d4science.org"; |
|
34 | 35 |
|
35 | 36 |
@Autowired |
36 | 37 |
private ResourceReader resourceReader; |
... | ... | |
39 | 40 |
private CatalogueAPIClient catalogueAPIClient; |
40 | 41 |
|
41 | 42 |
|
43 |
|
|
42 | 44 |
public String register(final Resource resource, final Resource type) throws IOException, ParthenosPublisherException, URISyntaxException { |
43 | 45 |
String resURI = resource.getURI(); |
44 | 46 |
log.debug(String.format("Catalogue --> Processing resource : %s with type: %s", resURI, type.getLocalName())); |
... | ... | |
114 | 116 |
addExtra(jg, "system:type", E7_Activity.getLocalName()); |
115 | 117 |
//specific class |
116 | 118 |
addExtra(jg, "instance of", resourceReader.findSpecificType(res, E7_Activity).getLocalName()); |
117 |
if (res.getURI().startsWith("http://parthenos.d4science.org"))
|
|
119 |
if (res.getURI().startsWith(PARTHENOS_BASE_URL))
|
|
118 | 120 |
addExtra(jg, "Parthenos URL", res.getURI()); |
119 | 121 |
addExtra(jg, "competence", resourceReader.getCompetence(res)); |
120 | 122 |
addExtra(jg, "provided by", Joiner.on(", ").join(providers)); |
... | ... | |
157 | 159 |
addExtra(jg, "system:type", E39_Actor.getLocalName()); |
158 | 160 |
//specific class |
159 | 161 |
addExtra(jg, "instance of", resourceReader.findSpecificType(res, E39_Actor).getLocalName()); |
160 |
if (res.getURI().startsWith("http://parthenos.d4science.org"))
|
|
162 |
if (res.getURI().startsWith(PARTHENOS_BASE_URL))
|
|
161 | 163 |
addExtra(jg, "Parthenos URL", res.getURI()); |
162 | 164 |
jg.writeEndArray(); |
163 | 165 |
|
... | ... | |
177 | 179 |
addExtra(jg, "system:type", E70_Thing.getLocalName()); |
178 | 180 |
//specific class |
179 | 181 |
addExtra(jg, "instance of", resourceReader.findSpecificType(res, E70_Thing).getLocalName()); |
180 |
if (res.getURI().startsWith("http://parthenos.d4science.org")) {
|
|
182 |
if (res.getURI().startsWith(PARTHENOS_BASE_URL)) {
|
|
181 | 183 |
addExtra(jg, "Parthenos URL", res.getURI()); |
182 | 184 |
} |
183 | 185 |
//TODO: things include digital objects, software, datasets, schema. Guess we should know what to add here. |
Also available in: Unified diff
Added constants for PARTHENOS_BASE_URL