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

refactor: start on a functional domain design implementation for ontologies (DEV-227) #2009

Conversation

subotic
Copy link
Collaborator

@subotic subotic commented Feb 25, 2022

resolves DEV-227

@subotic subotic self-assigned this Feb 25, 2022
Copy link
Collaborator

@irinaschubert irinaschubert left a comment

Cool, I'm looking forward to working on this.

Is there a reason why everything is equally placed on the top level of the folder structure? I would create one folder for all the new code and inside it one folder for each compartment (project, schema, resource, list,...). But perhaps I don't overlook all the consequences.

project/plugins.sbt Show resolved Hide resolved
import dsp.schema.domain.SchemaDomain.{UserID, UserProfile}

case class SchemaRepoTest() extends SchemaRepo {
private var map: Map[UserID, UserProfile] = Map()
Copy link
Collaborator

@irinaschubert irinaschubert Feb 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We agreed on never using var. Is there a good reason to use it here instead of val? If so, what is the reason?

Copy link
Collaborator Author

@subotic subotic Feb 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to every rule there are exceptions :-) This is the simplest way of implementing a key-value store. Since it is only for testing, it should be fine. I "stole" the code from John's workshop.

Copy link
Collaborator

@BalduinLandolt BalduinLandolt Mar 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could use more speaking variable names than "map"?

@subotic
Copy link
Collaborator Author

@subotic subotic commented Feb 25, 2022

Cool, I'm looking forward to working on this.

Is there a reason why everything is equally placed on the top level of the folder structure? I would create one folder for all the new code and inside it one folder for each compartment (project, schema, resource, list,...). But perhaps I don't overlook all the consequences.

for reasons of visibility. the modules are grouped by name. The webapi folder should at some point be renamed to something more fitting. take a look at some other larger scala repos:

Copy link
Collaborator

@BalduinLandolt BalduinLandolt left a comment

I do not yet fully understand everything, but it looks exciting

@@ -0,0 +1,17 @@
package dsp.api.main
Copy link
Collaborator

@BalduinLandolt BalduinLandolt Mar 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license statement missing (not only here)

}

def run = Server.start(8090, app)
}
Copy link
Collaborator

@BalduinLandolt BalduinLandolt Mar 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this shouldn't trigger me so much... but please add "automatically add line break at end of file" to your VS Code settings

import dsp.schema.domain.SchemaDomain.{UserID, UserProfile}

case class SchemaRepoTest() extends SchemaRepo {
private var map: Map[UserID, UserProfile] = Map()
Copy link
Collaborator

@BalduinLandolt BalduinLandolt Mar 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could use more speaking variable names than "map"?

//trying it out
val ontoInfo = OntologyInfo("test", "http://example.org/test", "Test", "Test")

val classOne = OntologyClass("ClassOne", "Class One", "Class One")
val propertyOne = OntologyProperty("PropertyOne", "Property One", "Property One", "http://example.org/test")

val classTwo = OntologyClass("ClassTwo", "Class Two", "Class Two")
val propertyTwo = OntologyProperty("PropertyTwo", "Property Two", "Property Two", "http://example.org/test")

val cardOne = Cardinality(classOne, propertyOne, CardinalityType.MinCardinalityOne)
val cardTwo = Cardinality(classTwo, propertyTwo, CardinalityType.MinCardinalityOne)
val cardThree = Cardinality(classOne, propertyTwo, CardinalityType.MinCardinalityOne)
val cardFour = Cardinality(classTwo, propertyOne, CardinalityType.MinCardinalityOne)

val exampleOnto: Ontology[Any with "ClassOne" with "ClassTwo", Any with "PropertyOne"] =
Ontology
.empty(ontoInfo)
.withClass(classOne)
.withClass(classTwo)
.withProperty(propertyOne)
//.withProperty(propertyOne)
//.withProperty(propertyTwo)
.withCardinality(cardOne)
.withCardinality(cardOne)

Copy link
Collaborator

@BalduinLandolt BalduinLandolt Mar 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this should eventually be moved to a separate spec file

@sonarcloud
Copy link

@sonarcloud sonarcloud bot commented Mar 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 11 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@subotic subotic merged commit 54cee7a into main Mar 2, 2022
11 checks passed
@subotic subotic deleted the wip/DEV-227-start-on-a-functional-domain-design-implementation-for-ontologies branch Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants