Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed jsonMapper as a param from the javadoc #11

Merged
merged 1 commit into from
Mar 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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