.entity("A concept must have a label!")
.build();
}
MGraph contentGraph = cgProvider.getContentGraph();
PlainLiteral preferredLabel = new PlainLiteralImpl(prefLabel,
new Language(lang));
if (contentGraph.filter(null, SKOS.prefLabel, preferredLabel).hasNext()) {
return Response.status(Status.CONFLICT)
.entity("A concept with the same label and language already exists!")
.build();
}
UriRef concept = getConceptUriRef(platformConfig, prefLabel);
contentGraph.add(new TripleImpl(concept, RDF.type,
SKOS.Concept));
String baseUri = platformConfig.getDefaultBaseUri().getUnicodeString();
contentGraph.add(new TripleImpl(concept, SKOS.inScheme,
new UriRef(baseUri + FREE_CONCEPT_SCHEME)));
contentGraph.add(new TripleImpl(concept, SKOS.prefLabel, preferredLabel));
if (!comment.isEmpty()) {
contentGraph.add(new TripleImpl(concept, RDFS.comment,
new PlainLiteralImpl(comment, new Language(lang))));
}
return Response.status(Status.CREATED).entity(concept.getUnicodeString())
.build();
}