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
refactor: start on a functional domain design implementation for ontologies (DEV-227) #2009
Conversation
…ign-implementation-for-ontologies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
import dsp.schema.domain.SchemaDomain.{UserID, UserProfile} | ||
|
||
case class SchemaRepoTest() extends SchemaRepo { | ||
private var map: Map[UserID, UserProfile] = Map() |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"?
for reasons of visibility. the modules are grouped by name. The
|
…ign-implementation-for-ontologies
…ign-implementation-for-ontologies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not yet fully understand everything, but it looks exciting
@@ -0,0 +1,17 @@ | |||
package dsp.api.main |
There was a problem hiding this comment.
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) | ||
} |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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) | ||
|
There was a problem hiding this comment.
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
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
resolves DEV-227