Check uniqueness of dct:identifier @param con @param iri @return
(RepositoryConnection con, IRI iri)
| 761 | * @return |
| 762 | */ |
| 763 | private static boolean isUnique(RepositoryConnection con, IRI iri) { |
| 764 | try (RepositoryResult<Statement> res = con.getStatements(iri, DCTERMS.IDENTIFIER, null)) { |
| 765 | while (res.hasNext()) { |
| 766 | String id = res.next().getObject().stringValue(); |
| 767 | if (id.isBlank()) { |
| 768 | LOG.warn("Empty dct:identifier for {}", iri); |
| 769 | } else { |
| 770 | if (!IDENTIFIERS.add(id)) { |
| 771 | LOG.error("{} ID {} already present, skipping ...", iri, id); |
| 772 | return false; |
| 773 | } |
| 774 | } |
| 775 | } |
| 776 | } |
| 777 | return true; |
| 778 | } |
| 779 | |
| 780 | /** |
| 781 | * Write DCAT dataset / service / series |