@Override public void processPropertyDocument(PropertyDocument propertyDocument) { try { this.rdfConverter.writePropertyDocument(propertyDocument); } catch (RDFHandlerException e) { // we cannot recover here throw new RuntimeException(e.toString(), e); } }
@Override public void processItemDocument(ItemDocument itemDocument) { try { this.rdfConverter.writeItemDocument(itemDocument); } catch (RDFHandlerException e) { // we cannot recover here throw new RuntimeException(e.toString(), e); } }
@Override public void close() { try { this.rdfWriter.finish(); } catch (RDFHandlerException e) { // we cannot recover here throw new RuntimeException(e.toString(), e); } try { this.output.close(); } catch (IOException e) { throw new RuntimeException(e.toString(), e); } }
@Override public void open() { try { this.rdfWriter.start(); this.rdfConverter.writeNamespaceDeclarations(); this.rdfConverter.writeBasicDeclarations(); } catch (RDFHandlerException e) { // we cannot recover here throw new RuntimeException(e.toString(), e); } }
RdfWriter.RDF_TYPE, noValueClass); } catch (RDFHandlerException e) { throw new RuntimeException(e.toString(), e);
@Override public Void visit(SomeValueSnak snak) { String rangeUri = getRangeUri(snak.getPropertyId()); if (rangeUri == null) { logger.error("Count not export SomeValueSnak for property " + snak.getPropertyId().getId() + ": OWL range not known."); return null; } String propertyUri = Vocabulary.getPropertyUri(snak.getPropertyId(), this.currentPropertyContext); Resource bnode = this.rdfWriter.getFreshBNode(); addSomeValuesRestriction(bnode, propertyUri, rangeUri); try { this.rdfWriter.writeTripleValueObject(this.currentSubject, RdfWriter.RDF_TYPE, bnode); } catch (RDFHandlerException e) { throw new RuntimeException(e.toString(), e); } return null; }
@Override public Void visit(ValueSnak snak) { String propertyUri = Vocabulary.getPropertyUri(snak.getPropertyId(), this.currentPropertyContext); IRI property = this.rdfWriter.getUri(propertyUri); Value value = valueRdfConverter.getRdfValue(snak.getValue(), snak.getPropertyId(), this.simple); if (value == null) { // if there is no complex representation and simple = false return null; } try { this.rdfWriter.writeTripleValueObject(this.currentSubject, property, value); } catch (RDFHandlerException e) { throw new RuntimeException(e.toString(), e); } return null; }