Skip to content

Commit

Permalink
Merge pull request #11 from ek08/master
Browse files Browse the repository at this point in the history
Removed jsonMapper as a param from the javadoc
  • Loading branch information
goneall authored Mar 13, 2021
2 parents 475e4f7 + cddda65 commit 929095d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/main/java/org/spdx/tools/schema/OwlToJsonSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2020 Source Auditor Inc.
*
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down Expand Up @@ -44,10 +44,10 @@
* @author Gary O'Neall
*
* Converts from RDF/OWL RDF/XML documents to JSON Schema draft 7
*
*
*/
public class OwlToJsonSchema extends AbstractOwlRdfConverter {

private static final String SCHEMA_VERSION_URI = "http://json-schema.org/draft-07/schema#";
private static final String RELATIONSHIP_TYPE = SpdxConstants.SPDX_NAMESPACE + SpdxConstants.CLASS_RELATIONSHIP;
static ObjectMapper jsonMapper = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT);
Expand Down Expand Up @@ -90,15 +90,14 @@ public ObjectNode convertToJsonSchema() {
OntClass relationshipClass = model.getOntClass(SpdxConstants.SPDX_NAMESPACE + SpdxConstants.CLASS_RELATIONSHIP);
Objects.requireNonNull(relationshipClass, "Missing SPDX Relationship class in OWL document");
docSchemaProperties.set("relationships", toArrayPropertySchema(relationshipClass, 0));

properties.set("Document", documentClassSchema);
root.set("properties", properties);
return root;
}

/**
* @param ontClass
* @param jsonMapper
* @param min Minimum number of array items
* @return JSON Schema of an array of item types represented by the ontClass
*/
Expand All @@ -116,7 +115,7 @@ private JsonNode toArrayPropertySchema(OntClass ontClass, int min) {

/**
* @param spdxClass RDF ontology class
* @return JSON Schema
* @return JSON Schema
*/
private ObjectNode ontClassToJsonSchema(OntClass spdxClass) {
ObjectNode retval = jsonMapper.createObjectNode();
Expand All @@ -139,7 +138,7 @@ private ObjectNode ontClassToJsonSchema(OntClass spdxClass) {
} else {
properties.set(checkConvertRenamedPropertyName(property.getLocalName()), derivePropertySchema(property, restrictions, false));
}

}
retval.set("properties", properties);
return retval;
Expand Down

0 comments on commit 929095d

Please sign in to comment.