From 77bbe889114b2a235c4a1c98c3a220e16e4a863c Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 20 May 2016 12:09:39 +0000 Subject: [PATCH] Creating IS model refs #4023 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/information-system-model@128735 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 36 +++++++++ .project | 23 ++++++ .settings/org.eclipse.core.resources.prefs | 6 ++ .settings/org.eclipse.jdt.core.prefs | 5 ++ .settings/org.eclipse.m2e.core.prefs | 4 + distro/LICENSE | 4 + distro/README | 65 ++++++++++++++++ distro/changelog.xml | 5 ++ distro/descriptor.xml | 31 ++++++++ distro/profile.xml | 26 +++++++ pom.xml | 77 +++++++++++++++++++ .../informationsystem/model/AccessPolicy.java | 16 ++++ .../gcube/informationsystem/model/Header.java | 29 +++++++ .../informationsystem/model/ValueSchema.java | 23 ++++++ .../model/entity/Entity.java | 18 +++++ .../informationsystem/model/entity/Facet.java | 9 +++ .../model/entity/Resource.java | 36 +++++++++ .../model/relation/ConsistOf.java | 17 ++++ .../model/relation/RelatedTo.java | 17 ++++ .../model/relation/Relation.java | 21 +++++ .../model/relation/RelationProperty.java | 56 ++++++++++++++ 21 files changed, 524 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 distro/LICENSE create mode 100644 distro/README create mode 100644 distro/changelog.xml create mode 100644 distro/descriptor.xml create mode 100644 distro/profile.xml create mode 100644 pom.xml create mode 100644 src/main/java/org/gcube/informationsystem/model/AccessPolicy.java create mode 100644 src/main/java/org/gcube/informationsystem/model/Header.java create mode 100644 src/main/java/org/gcube/informationsystem/model/ValueSchema.java create mode 100644 src/main/java/org/gcube/informationsystem/model/entity/Entity.java create mode 100644 src/main/java/org/gcube/informationsystem/model/entity/Facet.java create mode 100644 src/main/java/org/gcube/informationsystem/model/entity/Resource.java create mode 100644 src/main/java/org/gcube/informationsystem/model/relation/ConsistOf.java create mode 100644 src/main/java/org/gcube/informationsystem/model/relation/RelatedTo.java create mode 100644 src/main/java/org/gcube/informationsystem/model/relation/Relation.java create mode 100644 src/main/java/org/gcube/informationsystem/model/relation/RelationProperty.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..e43402f --- /dev/null +++ b/.classpath @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..01e12c5 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + information-system-model + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..29abf99 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..ec4300d --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/distro/LICENSE b/distro/LICENSE new file mode 100644 index 0000000..cdf50bd --- /dev/null +++ b/distro/LICENSE @@ -0,0 +1,4 @@ +gCube System - License +------------------------------------------------------------ + +${gcube.license} \ No newline at end of file diff --git a/distro/README b/distro/README new file mode 100644 index 0000000..80e728d --- /dev/null +++ b/distro/README @@ -0,0 +1,65 @@ +The gCube System - ${name} +-------------------------------------------------- + +${description} + + +${gcube.description} + +${gcube.funding} + + +Version +-------------------------------------------------- + +${version} (${buildDate}) + +Please see the file named "changelog.xml" in this directory for the release notes. + + +Authors +-------------------------------------------------- + +* Luca Frosini (luca.frosini-AT-isti.cnr.it), Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy). + +Maintainers +----------- + +* Luca Frosini (luca.frosini-AT-isti.cnr.it), Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy). + + +Download information +-------------------------------------------------- + +Source code is available from SVN: + ${scm.url} + +Binaries can be downloaded from the gCube website: + ${gcube.website} + + +Installation +-------------------------------------------------- + +Installation documentation is available on-line in the gCube Wiki: + ${gcube.wikiRoot}/InformationSystem + + +Documentation +-------------------------------------------------- + +Documentation is available on-line in the gCube Wiki: + ${gcube.wikiRoot}/InformationSystem + + +Support +-------------------------------------------------- + +Bugs and support requests can be reported in the gCube issue tracking tool: + ${gcube.issueTracking} + + +Licensing +-------------------------------------------------- + +This software is licensed under the terms you may find in the file named "LICENSE" in this directory. diff --git a/distro/changelog.xml b/distro/changelog.xml new file mode 100644 index 0000000..3de97a6 --- /dev/null +++ b/distro/changelog.xml @@ -0,0 +1,5 @@ + + + First Release + + \ No newline at end of file diff --git a/distro/descriptor.xml b/distro/descriptor.xml new file mode 100644 index 0000000..089683d --- /dev/null +++ b/distro/descriptor.xml @@ -0,0 +1,31 @@ + + servicearchive + + tar.gz + + / + + + ${distroDirectory} + / + true + + README + LICENSE + changelog.xml + profile.xml + + 755 + true + + + + + target/${build.finalName}.jar + /${artifactId} + + + \ No newline at end of file diff --git a/distro/profile.xml b/distro/profile.xml new file mode 100644 index 0000000..014ca47 --- /dev/null +++ b/distro/profile.xml @@ -0,0 +1,26 @@ + + + + Service + + ${description} + ${serviceClass} + ${artifactId} + 1.0.0 + + + ${artifactId} + ${version} + + ${groupId} + ${artifactId} + ${version} + + + ${build.finalName}.jar + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..4f16782 --- /dev/null +++ b/pom.xml @@ -0,0 +1,77 @@ + + 4.0.0 + + org.gcube.tools + maven-parent + 1.0.0 + + org.gcube.information-system + information-system-model + 1.0.0-SNAPSHOT + Information System Model + Information System Model + jar + + + UTF-8 + ${project.basedir}/distro + InformationSystem + + + + scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/${project.artifactId} + scm:https://svn.d4science.research-infrastructures.eu/gcube//trunk/information-system/${project.artifactId} + https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/${project.artifactId} + + + + + + org.slf4j + slf4j-api + 1.7.5 + provided + + + + + junit + junit + 4.11 + test + + + ch.qos.logback + logback-classic + 1.0.13 + test + + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + ${distroDirectory}/descriptor.xml + + + + + servicearchive + install + + single + + + + + + + + \ No newline at end of file diff --git a/src/main/java/org/gcube/informationsystem/model/AccessPolicy.java b/src/main/java/org/gcube/informationsystem/model/AccessPolicy.java new file mode 100644 index 0000000..139b6d1 --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/model/AccessPolicy.java @@ -0,0 +1,16 @@ +package org.gcube.informationsystem.model; + + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + */ +public interface AccessPolicy { + + public ValueSchema getPolicy(); + + public void setPolicy(ValueSchema policy); + + public String getNote(); + + public void setNote(String note); +} diff --git a/src/main/java/org/gcube/informationsystem/model/Header.java b/src/main/java/org/gcube/informationsystem/model/Header.java new file mode 100644 index 0000000..8f95aad --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/model/Header.java @@ -0,0 +1,29 @@ +/** + * + */ +package org.gcube.informationsystem.model; + +import java.util.Calendar; + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + * https://redmine.d4science.org/projects/bluebridge/wiki/Facets#Facet-Header + */ +public interface Header { + + public String getID(); + + public String getCreator(); + + public Calendar getCreationTime(); + + public Calendar getLastUpdateTime(); + + public String getName(); + + public String getDescription(); + + public String getVersion(); + + +} \ No newline at end of file diff --git a/src/main/java/org/gcube/informationsystem/model/ValueSchema.java b/src/main/java/org/gcube/informationsystem/model/ValueSchema.java new file mode 100644 index 0000000..8e847da --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/model/ValueSchema.java @@ -0,0 +1,23 @@ +/** + * + */ +package org.gcube.informationsystem.model; + +import java.net.URI; + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + * Base Interface for all type described by a value and a schema retrieved + * from a URI. + */ +public interface ValueSchema { + + public String getValue(); + + public void setValue(String value); + + public URI getSchema(); + + public void setSchema(URI schema); + +} diff --git a/src/main/java/org/gcube/informationsystem/model/entity/Entity.java b/src/main/java/org/gcube/informationsystem/model/entity/Entity.java new file mode 100644 index 0000000..5fe7405 --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/model/entity/Entity.java @@ -0,0 +1,18 @@ +/** + * + */ +package org.gcube.informationsystem.model.entity; + +import org.gcube.informationsystem.model.Header; + + + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + * + */ +public interface Entity { + + public Header getHeader(); + +} diff --git a/src/main/java/org/gcube/informationsystem/model/entity/Facet.java b/src/main/java/org/gcube/informationsystem/model/entity/Facet.java new file mode 100644 index 0000000..418a1a6 --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/model/entity/Facet.java @@ -0,0 +1,9 @@ +package org.gcube.informationsystem.model.entity; + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + * https://redmine.d4science.org/projects/bluebridge/wiki/Facets + */ +public interface Facet extends Entity { + +} diff --git a/src/main/java/org/gcube/informationsystem/model/entity/Resource.java b/src/main/java/org/gcube/informationsystem/model/entity/Resource.java new file mode 100644 index 0000000..be7b014 --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/model/entity/Resource.java @@ -0,0 +1,36 @@ +/** + * + */ +package org.gcube.informationsystem.model.entity; + +import org.gcube.informationsystem.model.relation.RelationProperty; + + + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + */ +public interface Resource extends Entity { + + + public void addFacet(Facet facet); + + public void addFacet(Facet facet, RelationProperty relationProperty); + + + public void attachFacet(Facet facet); + + public void attachFacet(Facet facet, RelationProperty relationProperty); + + public void detachFacet(Facet facet); + + + + public void attachResource(Resource resource); + + public void attachResource(Resource resource, RelationProperty relationProperty); + + public void detachResource(Resource resource); + + +} diff --git a/src/main/java/org/gcube/informationsystem/model/relation/ConsistOf.java b/src/main/java/org/gcube/informationsystem/model/relation/ConsistOf.java new file mode 100644 index 0000000..56a26c7 --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/model/relation/ConsistOf.java @@ -0,0 +1,17 @@ +/** + * + */ +package org.gcube.informationsystem.model.relation; + +import org.gcube.informationsystem.model.entity.Facet; +import org.gcube.informationsystem.model.entity.Resource; + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + * This interface models the Edge (link) from a {@link Resource} to a + * {@link Facet} which describe a part of it. + */ +public interface ConsistOf + extends Relation { + +} diff --git a/src/main/java/org/gcube/informationsystem/model/relation/RelatedTo.java b/src/main/java/org/gcube/informationsystem/model/relation/RelatedTo.java new file mode 100644 index 0000000..686cc8b --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/model/relation/RelatedTo.java @@ -0,0 +1,17 @@ +/** + * + */ +package org.gcube.informationsystem.model.relation; + +import org.gcube.informationsystem.model.entity.Resource; + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + * https://redmine.d4science.org/projects/bluebridge/wiki/Facets#Relation-Facet + * Please note that targetResource described in the wiki is implicit. The + * {@link OutVertex} of this Edge. Look at {@link RelatedTo#getTargetResource()} + */ +public interface RelatedTo + extends Relation { + +} diff --git a/src/main/java/org/gcube/informationsystem/model/relation/Relation.java b/src/main/java/org/gcube/informationsystem/model/relation/Relation.java new file mode 100644 index 0000000..bb4627a --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/model/relation/Relation.java @@ -0,0 +1,21 @@ +/** + * + */ +package org.gcube.informationsystem.model.relation; + +import org.gcube.informationsystem.model.entity.Entity; + + + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + */ +public interface Relation { + + public Out getSource(); + + public In getTarget(); + + public RelationProperty getRelationProperty(); + +} diff --git a/src/main/java/org/gcube/informationsystem/model/relation/RelationProperty.java b/src/main/java/org/gcube/informationsystem/model/relation/RelationProperty.java new file mode 100644 index 0000000..fc1a751 --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/model/relation/RelationProperty.java @@ -0,0 +1,56 @@ +/** + * + */ +package org.gcube.informationsystem.model.relation; + +import org.gcube.informationsystem.model.AccessPolicy; + + + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + * + */ +public interface RelationProperty { + + /** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + * The referential integrity value have their meaning taking in account the + * Edge direction. So that is the action to be made when an action occurs on + * source Vertex. + */ + public enum ReferentiaIntegrity { + + /** + * When the source Vertex is deleted also the target Vertex is deleted if + * there are no other incoming edge. + */ + onDeleteCascadeWhenOrphan, + + /** + * When the source Vertex is deleted also the target Vertex is always + * deleted + */ + onDeleteCascade, + + /** + * When the source Vertex is deleted also the target Vertex is keep. + * This is the standard behavior also if no integrity is declared. + */ + onDeleteKeep + + } + + public String getPurpose(); + + public void setPurpose(String purpose); + + public ReferentiaIntegrity getReferentialIntegrity(); + + public void setReferentialIntegrity(ReferentiaIntegrity referentialIntegrity); + + public AccessPolicy getPolicy(); + + public void setPolicy(AccessPolicy accessPolicy); + +}