Skip to content

Commit

Permalink
Introduces ObjectStorageService (#49)
Browse files Browse the repository at this point in the history
* Introduces `ObjectStorageService`

Represents the service to access an object storage. Moved http endpoint from storage service to this specific one, as only this one has an HTTP endpoint.

* Use 'rdfs:comment' instead of 'dc:description'

* Added more comments to storage services

Co-authored-by: Angelika Schneider <[email protected]>
  • Loading branch information
oxisto and anatheka authored Oct 24, 2022
1 parent 017c52d commit a7b98e2
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cloudpg/src/main/java/io/clouditor/graph/passes/Azure.kt
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ class AzurePass : CloudResourceDiscoveryPass() {
// specific to the Storage containers, e.g., authenticity, url,
// For now we fill it out as good as we can with the current ontology
val storageAccount =
StorageService(
ObjectStorageService(
HttpEndpoint(
auth,
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ class KubernetesPass : CloudResourceDiscoveryPass() {
if (service?.name == "postgres") {
val db =
RelationalDatabaseService(
null,
mutableListOf<Storage>(),
container,
service.ips,
Expand All @@ -168,7 +167,6 @@ class KubernetesPass : CloudResourceDiscoveryPass() {
if (service?.name == "mongo") {
val db =
DocumentDatabaseService(
null,
mutableListOf<Storage>(),
container,
service.ips,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class LocalTestingPass : Pass() {
if (service.name == "postgres") {
val db =
RelationalDatabaseService(
null,
mutableListOf<Storage>(),
null,
null,
Expand All @@ -132,7 +131,6 @@ class LocalTestingPass : Pass() {
if (service.name == "mongo") {
val db =
DocumentDatabaseService(
null,
mutableListOf<Storage>(),
null,
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@
<Declaration>
<Class IRI="http://graph.clouditor.io/classes/ObjectStorageRequest"/>
</Declaration>
<Declaration>
<Class IRI="http://graph.clouditor.io/classes/ObjectStorageService"/>
</Declaration>
<Declaration>
<Class IRI="http://graph.clouditor.io/classes/Operation"/>
</Declaration>
Expand Down Expand Up @@ -1572,6 +1575,17 @@
<Literal>xsd:de.fraunhofer.aisec.cpg.graph.Node</Literal>
</DataHasValue>
</SubClassOf>
<SubClassOf>
<Class IRI="http://graph.clouditor.io/classes/ObjectStorageService"/>
<Class IRI="http://graph.clouditor.io/classes/StorageService"/>
</SubClassOf>
<SubClassOf>
<Class IRI="http://graph.clouditor.io/classes/ObjectStorageService"/>
<ObjectSomeValuesFrom>
<ObjectProperty abbreviatedIRI="prop:offers"/>
<Class IRI="http://graph.clouditor.io/classes/HttpEndpoint"/>
</ObjectSomeValuesFrom>
</SubClassOf>
<SubClassOf>
<Class IRI="http://graph.clouditor.io/classes/Operation"/>
<Class IRI="http://graph.clouditor.io/classes/Functionality"/>
Expand Down Expand Up @@ -1697,13 +1711,6 @@
<Class IRI="http://graph.clouditor.io/classes/Storage"/>
</ObjectSomeValuesFrom>
</SubClassOf>
<SubClassOf>
<Class IRI="http://graph.clouditor.io/classes/StorageService"/>
<ObjectSomeValuesFrom>
<ObjectProperty abbreviatedIRI="prop:offers"/>
<Class IRI="http://graph.clouditor.io/classes/HttpEndpoint"/>
</ObjectSomeValuesFrom>
</SubClassOf>
<SubClassOf>
<Class IRI="http://graph.clouditor.io/classes/TransportEncryption"/>
<Class IRI="http://graph.clouditor.io/classes/Confidentiality"/>
Expand Down Expand Up @@ -2403,6 +2410,11 @@ name = metadata.name</Literal>
<IRI>http://graph.clouditor.io/classes/DatabaseQuery</IRI>
<Literal>DatabaseQuery</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:comment"/>
<IRI>http://graph.clouditor.io/classes/DatabaseService</IRI>
<Literal>This class represents a database service. For example, a postgres SQL server would be modelled as a database service (with a host and IP) and the individual tables or collections would be modelled as a DatabaseStorage entity.</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:label"/>
<IRI>http://graph.clouditor.io/classes/DatabaseService</IRI>
Expand Down Expand Up @@ -2614,7 +2626,7 @@ name = metadata.name</Literal>
<Literal xml:lang="english">NetworkSecurityGroup</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty IRI="http://purl.org/dc/elements/1.1/description"/>
<AnnotationProperty abbreviatedIRI="rdfs:comment"/>
<IRI>http://graph.clouditor.io/classes/NetworkService</IRI>
<Literal>A NetworkService is an application (on the network layer) running on a Compute resource. It provides access to a resource</Literal>
</AnnotationAssertion>
Expand Down Expand Up @@ -2653,6 +2665,16 @@ name = metadata.name</Literal>
<IRI>http://graph.clouditor.io/classes/ObjectStorageRequest</IRI>
<Literal xml:lang="english">ObjectStorageRequest</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:comment"/>
<IRI>http://graph.clouditor.io/classes/ObjectStorageService</IRI>
<Literal>An object storage service represents the network service that is used to access a list of object storage containers. The storage itself is modelled as a ObjectStorage. The service has an http endpoint.</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:label"/>
<IRI>http://graph.clouditor.io/classes/ObjectStorageService</IRI>
<Literal>ObjectStorageService</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:label"/>
<IRI>http://graph.clouditor.io/classes/Operation</IRI>
Expand Down Expand Up @@ -2728,6 +2750,11 @@ name = metadata.name</Literal>
<IRI>http://graph.clouditor.io/classes/Storage</IRI>
<Literal xml:lang="english">Storage</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:comment"/>
<IRI>http://graph.clouditor.io/classes/StorageService</IRI>
<Literal>This entity represents a network-based service that can be used to access a particular storage backend. It has multiple subclasses, e.g., for databases or object stores. It has a list of storage resources associated to it.</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:label"/>
<IRI>http://graph.clouditor.io/classes/StorageService</IRI>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ class OWLCloudOntology(filepath: String, private val resourceNameFromOwlFile: St
for (elem in nce.classesInSignature) {
for (item in EntitySearcher.getAnnotationObjects(elem, ontology!!)) {
if (item != null) {
if (item.property.iri.remainder.get().toString() == "description") {
if (item.property.iri.remainder.get() == "comment") {
var description = item.value.toString()
return description.substring(1, description.length-1)
}
Expand Down

0 comments on commit a7b98e2

Please sign in to comment.