/** * Adds RDF triples for each graph in the current node map to an RDF * dataset. * * @return the RDF dataset. * @throws JsonLdError * If there was an error converting from JSON-LD to RDF. */ public RDFDataset toRDF() throws JsonLdError { // TODO: make the default generateNodeMap call (i.e. without a // graphName) create and return the nodeMap final Map<String, Object> nodeMap = newMap(); nodeMap.put("@default", newMap()); generateNodeMap(this.value, nodeMap); final RDFDataset dataset = new RDFDataset(this); for (final Map.Entry<String, Object> stringObjectEntry : nodeMap.entrySet()) { // 4.1) if (JsonLdUtils.isRelativeIri(stringObjectEntry.getKey())) { continue; } final Map<String, Object> graph = (Map<String, Object>) stringObjectEntry.getValue(); replaceBlankNode(graph); dataset.graphToRDF(stringObjectEntry.getKey(), graph); } return dataset; }
} else if (context != null && JsonLdUtils.isRelativeIri(value)) { throw new JsonLdError(Error.INVALID_IRI_MAPPING, "not an absolute IRI: " + value);
} else if (context != null && JsonLdUtils.isRelativeIri(value)) { throw new JsonLdError(Error.INVALID_IRI_MAPPING, "not an absolute IRI: " + value);
/** * Adds RDF triples for each graph in the current node map to an RDF * dataset. * * @return the RDF dataset. * @throws JsonLdError * If there was an error converting from JSON-LD to RDF. */ public RDFDataset toRDF() throws JsonLdError { // TODO: make the default generateNodeMap call (i.e. without a // graphName) create and return the nodeMap final Map<String, Object> nodeMap = newMap(); nodeMap.put(JsonLdConsts.DEFAULT, newMap()); generateNodeMap(this.value, nodeMap); final RDFDataset dataset = new RDFDataset(this); for (final String graphName : nodeMap.keySet()) { // 4.1) if (JsonLdUtils.isRelativeIri(graphName)) { continue; } final Map<String, Object> graph = (Map<String, Object>) nodeMap.get(graphName); dataset.graphToRDF(graphName, graph); } return dataset; }
/** * Adds RDF triples for each graph in the current node map to an RDF * dataset. * * @return the RDF dataset. * @throws JsonLdError * If there was an error converting from JSON-LD to RDF. */ public RDFDataset toRDF() throws JsonLdError { // TODO: make the default generateNodeMap call (i.e. without a // graphName) create and return the nodeMap final Map<String, Object> nodeMap = newMap(); nodeMap.put(JsonLdConsts.DEFAULT, newMap()); generateNodeMap(this.value, nodeMap); final RDFDataset dataset = new RDFDataset(this); for (final String graphName : nodeMap.keySet()) { // 4.1) if (JsonLdUtils.isRelativeIri(graphName)) { continue; } final Map<String, Object> graph = (Map<String, Object>) nodeMap.get(graphName); dataset.graphToRDF(graphName, graph); } return dataset; }
} else if (context != null && JsonLdUtils.isRelativeIri(value)) { throw new JsonLdError(Error.INVALID_IRI_MAPPING, "not an absolute IRI: " + value);
if (isObject(item)) { id = (String) ((Map<String, Object>) item).get("@id"); if (JsonLdUtils.isRelativeIri(id)) { return null;
if (JsonLdUtils.isRelativeIri(id)) { continue; else if (JsonLdUtils.isRelativeIri(property)) { continue; } else {
if (isObject(item)) { id = (String) ((Map<String, Object>) item).get("@id"); if (JsonLdUtils.isRelativeIri(id)) { return null;
if (JsonLdUtils.isRelativeIri(id)) { continue; else if (JsonLdUtils.isRelativeIri(property)) { continue; } else {
if (isObject(item)) { id = (String) ((Map<String, Object>) item).get("@id"); if (JsonLdUtils.isRelativeIri(id)) { return null;
if (JsonLdUtils.isRelativeIri(id)) { continue; else if (JsonLdUtils.isRelativeIri(property)) { continue; } else {