2019-03-22 15:51:44 +01:00
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
package org.gcube.resourcemanagement.model.reference.entities.facets;
|
|
|
|
|
|
2020-07-07 17:12:10 +02:00
|
|
|
|
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
2019-03-22 15:51:44 +01:00
|
|
|
|
import org.gcube.informationsystem.model.reference.entities.Facet;
|
|
|
|
|
import org.gcube.informationsystem.types.annotations.ISProperty;
|
2020-12-15 18:38:41 +01:00
|
|
|
|
import org.gcube.informationsystem.types.reference.Change;
|
|
|
|
|
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
|
|
|
|
import org.gcube.informationsystem.utils.TypeVersion;
|
2019-03-22 15:51:44 +01:00
|
|
|
|
import org.gcube.resourcemanagement.model.impl.entities.facets.SchemaFacetImpl;
|
2020-12-21 13:59:53 +01:00
|
|
|
|
import org.gcube.resourcemanagement.model.reference.properties.ValueSchema;
|
2019-03-22 15:51:44 +01:00
|
|
|
|
|
|
|
|
|
/**
|
2020-12-21 13:59:53 +01:00
|
|
|
|
* SchemaFacet captures information on any schema,
|
|
|
|
|
* i.e., a vocabulary used to validate a document associated with a resource.
|
|
|
|
|
*
|
|
|
|
|
* Examples of schema are JavaScript Object Notation (JSON) schema and XML schema.
|
|
|
|
|
*
|
|
|
|
|
* JSON schema "is a vocabulary that allows you to annotate and validate JSON documents".
|
|
|
|
|
* JSON schema is under standardisation by Internet Engineering Task force (IETF)
|
2021-02-22 09:42:34 +01:00
|
|
|
|
* (see references at https://json-schema.org/specification.html).
|
2020-12-21 13:59:53 +01:00
|
|
|
|
* XSD defines the legal building blocks of an XML document.
|
|
|
|
|
* DTD defines the structure and the legal elements and attributes of an XML document.
|
|
|
|
|
*
|
2021-03-02 16:16:35 +01:00
|
|
|
|
* https://wiki.gcube-system.org/gcube/GCube_Model#Schema_Facet
|
2020-12-21 13:59:53 +01:00
|
|
|
|
*
|
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
2019-03-22 15:51:44 +01:00
|
|
|
|
*/
|
|
|
|
|
@JsonDeserialize(as=SchemaFacetImpl.class)
|
2020-12-15 18:38:41 +01:00
|
|
|
|
@TypeMetadata(
|
|
|
|
|
name = SchemaFacet.NAME,
|
2020-12-21 13:59:53 +01:00
|
|
|
|
description = "SchemaFacet captures information on any schema, "
|
|
|
|
|
+ "i.e., a vocabulary used to validate a document associated with a resource.\n"
|
|
|
|
|
+ "Examples of schema are JavaScript Object Notation (JSON) schema and XML schema.\n"
|
|
|
|
|
+ "JSON schema \"is a vocabulary that allows you to annotate and validate JSON documents\".\n"
|
|
|
|
|
+ "JSON schema is under standardisation by Internet Engineering Task force (IETF) "
|
2021-02-22 09:42:34 +01:00
|
|
|
|
+ "(see references at https://json-schema.org/specification.html).\n"
|
2020-12-21 13:59:53 +01:00
|
|
|
|
+ "XSD defines the legal building blocks of an XML document.\n"
|
|
|
|
|
+ "DTD defines the structure and the legal elements and attributes of an XML document.",
|
2020-12-15 18:38:41 +01:00
|
|
|
|
version = TypeVersion.MINIMAL_VERSION_STRING
|
|
|
|
|
)
|
|
|
|
|
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
2019-03-22 15:51:44 +01:00
|
|
|
|
public interface SchemaFacet extends Facet {
|
|
|
|
|
|
|
|
|
|
public static final String NAME = "SchemaFacet"; // SchemaFacet.class.getSimpleName();
|
|
|
|
|
|
|
|
|
|
public static final String NAME_PROPERTY = "name";
|
|
|
|
|
|
2020-12-21 13:59:53 +01:00
|
|
|
|
@ISProperty(name=NAME_PROPERTY, description = "Schema Name", mandatory=true, nullable=false)
|
2019-03-22 15:51:44 +01:00
|
|
|
|
public String getName();
|
|
|
|
|
|
|
|
|
|
public void setName(String name);
|
|
|
|
|
|
2020-12-21 13:59:53 +01:00
|
|
|
|
@ISProperty(description = "Schema Description", mandatory=true, nullable=false)
|
2019-03-22 15:51:44 +01:00
|
|
|
|
public String getDescription();
|
|
|
|
|
|
|
|
|
|
public void setDescription(String description);
|
|
|
|
|
|
2020-12-21 13:59:53 +01:00
|
|
|
|
@ISProperty(description = "The 'value' property contains the defined 'schema' "
|
|
|
|
|
+ "that in turn is validated by the schema available at the URL indicated in the ’schema’ property. "
|
|
|
|
|
+ "An example could be an XSD schema instantiation as 'value' and the URL of the DTD defining the XSD as 'schema' "
|
|
|
|
|
+ "i.e., https://www.w3.org/2009/XMLSchema/XMLSchema.dtd.")
|
|
|
|
|
public ValueSchema getSchema();
|
2019-03-22 15:51:44 +01:00
|
|
|
|
|
2020-12-21 13:59:53 +01:00
|
|
|
|
public void setSchema(ValueSchema schema);
|
2019-03-22 15:51:44 +01:00
|
|
|
|
|
2020-12-21 13:59:53 +01:00
|
|
|
|
}
|