diff --git a/pom.xml b/pom.xml
index f8d384a..fc0f51a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
4.3.0
2.14.2
2.0.13
- 1.2.0
+ 1.3.0
@@ -107,7 +107,7 @@
org.slf4j
slf4j-simple
${slf4j.version}
-
+
diff --git a/src/main/java/dev/ikm/tinkar/sandbox/Sept2024ConnectathonStarterData.java b/src/main/java/dev/ikm/tinkar/sandbox/Sept2024ConnectathonStarterData.java
index 93ee9a7..8556a35 100644
--- a/src/main/java/dev/ikm/tinkar/sandbox/Sept2024ConnectathonStarterData.java
+++ b/src/main/java/dev/ikm/tinkar/sandbox/Sept2024ConnectathonStarterData.java
@@ -1,33 +1,27 @@
package dev.ikm.tinkar.sandbox;
-import dev.ikm.tinkar.common.id.PublicId;
-import dev.ikm.tinkar.common.id.PublicIds;
+import dev.ikm.tinkar.common.service.CachingService;
+import dev.ikm.tinkar.common.service.PrimitiveData;
+import dev.ikm.tinkar.common.service.ServiceKeys;
+import dev.ikm.tinkar.common.service.ServiceProperties;
import dev.ikm.tinkar.common.util.uuid.UuidUtil;
+import dev.ikm.tinkar.composer.Attachable;
import dev.ikm.tinkar.composer.Composer;
import dev.ikm.tinkar.composer.Session;
import dev.ikm.tinkar.composer.assembler.ConceptAssembler;
import dev.ikm.tinkar.composer.assembler.PatternAssembler;
+import dev.ikm.tinkar.composer.assembler.SemanticAssembler;
import dev.ikm.tinkar.composer.template.FullyQualifiedName;
import dev.ikm.tinkar.composer.template.Identifier;
import dev.ikm.tinkar.composer.template.StatedAxiom;
import dev.ikm.tinkar.composer.template.Synonym;
import dev.ikm.tinkar.composer.template.USDialect;
-import dev.ikm.tinkar.entity.EntityService;
-import dev.ikm.tinkar.entity.RecordListBuilder;
-import dev.ikm.tinkar.entity.SemanticEntity;
-import dev.ikm.tinkar.entity.SemanticEntityVersion;
-import dev.ikm.tinkar.entity.SemanticRecord;
-import dev.ikm.tinkar.entity.SemanticRecordBuilder;
-import dev.ikm.tinkar.entity.SemanticVersionRecord;
-import dev.ikm.tinkar.entity.SemanticVersionRecordBuilder;
import dev.ikm.tinkar.entity.export.ExportEntitiesController;
-import dev.ikm.tinkar.starterdata.StarterData;
import dev.ikm.tinkar.starterdata.UUIDUtility;
import dev.ikm.tinkar.terms.EntityProxy;
import dev.ikm.tinkar.terms.EntityProxy.Concept;
import dev.ikm.tinkar.terms.State;
import dev.ikm.tinkar.terms.TinkarTerm;
-import org.eclipse.collections.api.factory.Lists;
import org.eclipse.collections.api.list.MutableList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -42,109 +36,38 @@
public class Sept2024ConnectathonStarterData {
private static final Logger log = LoggerFactory.getLogger(Sept2024ConnectathonStarterData.class);
- private static final String EXAMPLE_UUCM = "lb/in^2";
private final File exportFile;
- private final StarterData starterData;
private final UUIDUtility uuidUtility = new UUIDUtility();
-
- private final Composer composer = new Composer("Sept 2024 Connectathon Starter Data");
private final Session session;
public Sept2024ConnectathonStarterData(File exportDataStore, File exportFile) {
this.exportFile = exportFile;
- starterData = new StarterData(exportDataStore, uuidUtility)
- .init()
- .authoringSTAMP(
- TinkarTerm.ACTIVE_STATE,
- System.currentTimeMillis(),
- TinkarTerm.USER,
- TinkarTerm.PRIMORDIAL_MODULE,
- TinkarTerm.PRIMORDIAL_PATH);
+ CachingService.clearAll();
+ ServiceProperties.set(ServiceKeys.DATA_STORE_ROOT, exportDataStore);
+ PrimitiveData.selectControllerByName("Open SpinedArrayStore");
+ PrimitiveData.start();
+ Composer composer = new Composer("Sept 2024 Connectathon Starter Data");
session = composer.open(State.ACTIVE, TinkarTerm.USER, TinkarTerm.PRIMORDIAL_MODULE, TinkarTerm.PRIMORDIAL_PATH);
- createComposerConcepts();
configureConceptsAndPatterns();
composer.commitSession(session);
- starterData.build();
exportStarterData();
- starterData.shutdown();
- }
-
- private void createComposerConcepts() {
- Concept performance = Concept.make("Performance", UUID.fromString("395cc864-7c51-4072-b3e7-f9195b40053a"));
- session.compose((ConceptAssembler conceptAssembler) -> conceptAssembler
- .concept(performance)
- .attach((FullyQualifiedName fqn) -> fqn
- .language(ENGLISH_LANGUAGE)
- .text("Performance")
- .caseSignificance(DESCRIPTION_NOT_CASE_SENSITIVE)
- .attach((USDialect usDialect) -> usDialect.acceptability(TinkarTerm.PREFERRED)))
- .attach((Synonym synonym) -> synonym
- .text("Performance")
- .language(ENGLISH_LANGUAGE)
- .caseSignificance(DESCRIPTION_NOT_CASE_SENSITIVE)
- .attach((USDialect usDialect) -> usDialect.acceptability(TinkarTerm.PREFERRED)))
- .attach((Identifier identifier) -> identifier
- .source(TinkarTerm.UNIVERSALLY_UNIQUE_IDENTIFIER)
- .identifier(performance.asUuidArray()[0].toString()))
- .attach((StatedAxiom axiom) -> axiom
- .isA(TinkarTerm.MODEL_CONCEPT))
- );
-
+ PrimitiveData.stop();
}
private void configureConceptsAndPatterns() {
+ createConcept(Concept.make("Performance", UUID.fromString("395cc864-7c51-4072-b3e7-f9195b40053a")))
+ .attach((StatedAxiom axiom) -> axiom.isA(TinkarTerm.MODEL_CONCEPT));
+
configureConnectathonPatterns();
configureValueContraintSemantics();
}
- private void configureValueContraintSemantics() {
- Concept cdcField1 = Concept.make("CDC", UUID.nameUUIDFromBytes("LP207920-2".getBytes()));
- starterData.concept(cdcField1)
- .synonym("CDC", TinkarTerm.PREFERRED)
- .fullyQualifiedName("Center For Disease Control and Prevention", TinkarTerm.US_ENGLISH_DIALECT)
- .identifier(TinkarTerm.UNIVERSALLY_UNIQUE_IDENTIFIER, cdcField1.asUuidArray()[0].toString())
- .build();
-
- createBMISemantic("Underweight (finding)", "248342006", cdcField1, 0F, TinkarTerm.LESS_THAN, 18.5F);
- createBMISemantic("Normal weight (finding)", "43664005", cdcField1, 18.5F, TinkarTerm.LESS_THAN_OR_EQUAL_TO, 24.99F);
- createBMISemantic("Obese (finding)", "414915002", cdcField1, 30F, TinkarTerm.LESS_THAN, 500F);
- createBMISemantic("Body mass index 30+ - obesity (finding)", "162864005", cdcField1, 30F, TinkarTerm.LESS_THAN, 500F);
- createBMISemantic("Obese class I (finding) (Body mass index 30.00 to 34.99)", "443371000124107", cdcField1, 30F, TinkarTerm.LESS_THAN_OR_EQUAL_TO, 34.99F);
- createBMISemantic("Obese class II (finding) ( Body mass index 35.00 to 39.99)", "443381000124105", cdcField1, 35F, TinkarTerm.LESS_THAN_OR_EQUAL_TO, 39.99F);
- createBMISemantic("Body mass index 40+ - severely obese (finding)", "408512008", cdcField1, 40F, TinkarTerm.LESS_THAN, 500F);
- createBMISemantic("Obese class III (finding) (Body mass index equal to or greater than 40)", "819948005", cdcField1, 40F, TinkarTerm.LESS_THAN, 500F);
- }
-
- private void createBMISemantic(String description, String snomedctId, Concept cdcField1, float referenceRangeMinimum,
- Concept maxRefRangeOperator, float referenceRangeMaximum) {
-
- Concept concept = makeBmiConcept(description, snomedctId);
-
- MutableList