@Nonnull public As unmarshal (final @Nonnull List<Statement> statements, final @Nonnull Context context) { return new Habitat(findId(statements, context)); } }
@Nonnull public As unmarshal (final @Nonnull List<Statement> statements, final @Nonnull Context context) { return new Adaptation(findId(statements, context)); } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull protected FactSheet loadFactSheet (final @Nonnull Graph graph) throws NotFoundException { final GraphUnmarshaller unmarshaller = new GraphUnmarshallerImpl(); unmarshaller.registerStatementUnmarshallerFactory(new WoUnmarshallerFactory()); return unmarshaller.unmarshal(graph, BbcVocabulary.TYPE_WO_SPECIES); }
return new FactSheetUnmarshaller(); return new MovieUnmarshaller(); return new MovieUnmarshaller(); return new StillImageUnmarshaller(); return new AdaptationUnmarshaller(); return new HabitatUnmarshaller(); return new BiblioUnmarshaller();
@Nonnull public As unmarshal (final @Nonnull List<Statement> statements, final @Nonnull Context context) { final Id id = findId(statements, context); Biblio biblio = new Biblio(id); for (final Statement statement : statements) { final String predicate = statement.getPredicate().stringValue(); if (predicate.startsWith(NS_DC_TERMS)) { final Key<Object> key = new Key<Object>(predicate); biblio = biblio.with(key, deserialize(statement.getObject())); } else if (!predicate.equals(TYPE_RDF_TYPE.stringValue()) && !predicate.equals(ID_FOAF_PRIMARY_TOPIC.stringValue())) { System.err.println("BIBLIO Unused statement: " + statement); } } return biblio; } }
@Nonnull public As unmarshal (final @Nonnull List<Statement> statements, final @Nonnull Context context) { final Id id = findId(statements, context); Media movie = new Media().with(Media.ID, id).with(DC_RIGHTS, BBC_SYNDICATION_GUIDELINES); for (final Statement statement : statements) { final String predicate = statement.getPredicate().stringValue(); if (predicate.startsWith(NS_DC_TERMS)) { final Key<Object> key = new Key<Object>(predicate); movie = movie.with(key, deserialize(statement.getObject())); } else if (!predicate.equals(TYPE_RDF_TYPE.stringValue()) && !predicate.equals(BbcVocabulary.ID_PO_SUBJECT.stringValue())) { System.err.println("MOVIE Unused statement: " + statement); } } return movie; } }
@Nonnull public As unmarshal (final @Nonnull List<Statement> statements, final @Nonnull Context context) final Id id = findId(statements, context); FactSheet factSheet = new FactSheet(id).with(DC_PUBLISHER, BbcFactSheetProvider.BBC) .with(DC_RIGHTS, BBC_SYNDICATION_GUIDELINES); factSheet = factSheet.with(key, deserialize(object));
@Nonnull public As unmarshal (final @Nonnull List<Statement> statements, final @Nonnull Context context) { // TODO: Android seems unable to read many large images from BBC, so we resort to thumbnails final Id imageId = findId(statements, context); for (final Statement statement2 : context.findStatements(ID_FOAF_THUMBNAIL, null)) { if (statement2.getSubject().stringValue().equals(imageId.stringValue())) { return new Media().with(Media.ID, new Id(statement2.getObject().stringValue())); } } return new Media().with(Media.ID, imageId); } }