Skip to content

Commit

Permalink
Merge branch 'master' into parser
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd authored Mar 1, 2022
2 parents 1a30267 + cf8d73b commit d5c31ee
Show file tree
Hide file tree
Showing 17 changed files with 1,047 additions and 353 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ install:

# command to run tests
script:
- touch src/schema/ocl.yaml && make test
- touch src/schema/kgcl.yaml && make test

10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SCHEMA_NAMES = $(patsubst $(SCHEMA_DIR)/%.yaml, %, $(SOURCE_FILES))

SCHEMA_NAME = kgcl
SCHEMA_SRC = $(SCHEMA_DIR)/$(SCHEMA_NAME).yaml
TGTS = graphql jsonschema ldcontext docs owl csv graphql python shex
TGTS = graphql jsonschema ldcontext docs owl csv graphql python shex sql

#GEN_OPTS = --no-mergeimports
GEN_OPTS =
Expand All @@ -22,10 +22,10 @@ t:
echo:
echo $(patsubst %,gen-%,$(TGTS))

test: all pytest
test: all test_framework

pytest:
pytest
test_framework:
pipenv run python -m unittest discover -p 'test_*.py'

install:
. environment.sh
Expand Down Expand Up @@ -80,7 +80,7 @@ target/ldcontext/%.context.jsonld: $(SCHEMA_DIR)/%.yaml tdir-ldcontext

### -- SQL schema --
# TODO: modularize imports. For now imports are merged.
gen-sqlddl: target/sql/$(SCHEMA_NAME).schema.sql
gen-sql: target/sql/$(SCHEMA_NAME).schema.sql
target/sql/%.schema.sql: $(SCHEMA_DIR)/%.yaml tdir-sql
gen-sqlddl $(GEN_OPTS) --dialect sqlite $< > $@

Expand Down
2 changes: 2 additions & 0 deletions examples/de-novo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ change_set:
- {type: NewSynonym, about_node: ANAT:Forelimb, new_value: "upper limb"}
- {type: ClassCreation, node_id: ANAT:Hindlimb, name: "hindlimb", superclass: ANAT:Limb}
- {type: NewSynonym, about_node: ANAT:Hindlimb, new_value: "lower limb"}
- {type: SetLanguageForName, about_node: ANAT:Hindlimb, new_value: "en"}
- {type: NewSynonym, about_node: ANAT:Mouse, new_value: "bouche", language: "fr"}
#- {type: ClassCreation, node_id: ANAT:Foot, name: "foot", superclass: ANAT:BodyPart, relationship: {predicate: ANAT:part-of, filler: ANAT:Hindlimb}}
#- {type: ClassCreation, node_id: ANAT:Hand, name: "hand", superclass: ANAT:BodyPart, relationship: {predicate: ANAT:part-of, filler: ANAT:Hindlimb}, was_generated_by: uuid:e887d3aac33f} ## deliberate mistake
#- {type: NodeMove, about_node: ANAT:Hand, old_predicate: ANAT:part-of, new_predicate: ANAT:Hindlimb, new_parent: ANAT:Forelimb}
Expand Down
81 changes: 71 additions & 10 deletions graphql/kgcl.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type AddNodeToSubset implements AddToSubset
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
inSubset: OntologySubset
}

Expand Down Expand Up @@ -86,6 +87,7 @@ type ClassCreation
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
nodeId: Node
name: String
owlType: OwlTypeEnum
Expand Down Expand Up @@ -134,16 +136,10 @@ interface Creation

type DatatypeChange
{
id: String!
wasGeneratedBy: Activity
seeAlso: String
pullRequest: String
creator: String
changeDate: String
contributor: String
hasUndo: Change
oldValue: String
newValue: String
}

interface DatatypeOrLanguageTagChange
{
}

interface Deletion
Expand Down Expand Up @@ -275,6 +271,12 @@ type InstanceNode
owlType: OwlTypeEnum
}

type LanguageTagChange
{
oldValue: LanguageTag
newValue: LanguageTag
}

type LogicalAxiomChange
{
id: String!
Expand All @@ -293,6 +295,26 @@ type LogicalDefinition
{
}

type MappingCreation implements Creation
{
id: String!
wasGeneratedBy: Activity
seeAlso: String
pullRequest: String
creator: String
changeDate: String
contributor: String
hasUndo: Change
oldValue: String
newValue: String
aboutEdge: Edge
subject: Node
predicate: Node
object: Node
annotationSet: Annotation
changeDescription: String
}

type MultiNodeObsoletion
{
id: String!
Expand Down Expand Up @@ -321,6 +343,7 @@ type NameBecomesSynonym
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
change1: NodeRename
change2: NewSynonym
changeDescription: String
Expand All @@ -338,6 +361,7 @@ type NewSynonym
hasUndo: Change
oldValue: String
aboutNode: Node
language: LanguageTag
newValue: String
}

Expand All @@ -353,6 +377,7 @@ type NewTextDefinition
hasUndo: Change
oldValue: String
aboutNode: Node
language: LanguageTag
newValue: String
}

Expand All @@ -377,6 +402,7 @@ type NodeAnnotationChange
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
}

type NodeAnnotationReplacement
Expand All @@ -392,6 +418,7 @@ type NodeAnnotationReplacement
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
}

interface NodeChange
Expand All @@ -407,6 +434,7 @@ interface NodeChange
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
}

type NodeCreation implements Creation
Expand All @@ -422,6 +450,7 @@ type NodeCreation implements Creation
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
nodeId: Node
name: String
owlType: OwlTypeEnum
Expand Down Expand Up @@ -459,6 +488,7 @@ type NodeDeletion implements Deletion
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
changeDescription: String
}

Expand All @@ -474,6 +504,7 @@ type NodeDirectMerge implements AllowsAutomaticReplacementOfEdges
hasUndo: Change
oldValue: String
newValue: String
language: LanguageTag
hasNondirectReplacement: [Node]
associatedChangeSet: [Change]
about: OntologyElement
Expand Down Expand Up @@ -512,6 +543,7 @@ type NodeObsoletion implements Obsoletion
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
hasDirectReplacement: Node
hasNondirectReplacement: [Node]
changeDescription: String
Expand All @@ -532,6 +564,7 @@ type NodeObsoletionWithDirectReplacement implements AllowsAutomaticReplacementOf
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
hasNondirectReplacement: [Node]
associatedChangeSet: [Change]
about: OntologyElement
Expand All @@ -552,6 +585,7 @@ type NodeObsoletionWithNoDirectReplacement
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
hasDirectReplacement: Node
associatedChangeSet: [Change]
about: OntologyElement
Expand All @@ -570,6 +604,7 @@ type NodeRename
contributor: String
hasUndo: Change
aboutNode: Node
language: LanguageTag
oldValue: String
newValue: String
hasTextualDiff: TextualDiff
Expand Down Expand Up @@ -606,6 +641,7 @@ type NodeSynonymChange
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
}

interface NodeTextDefinitionChange
Expand All @@ -621,6 +657,7 @@ interface NodeTextDefinitionChange
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
}

type NodeUnobsoletion implements Unobsoletion
Expand All @@ -636,6 +673,7 @@ type NodeUnobsoletion implements Unobsoletion
oldValue: String
newValue: String
aboutNode: Node
language: LanguageTag
changeDescription: String
replacedBy: Node
consider: Node
Expand Down Expand Up @@ -716,6 +754,7 @@ type RemoveSynonym
hasUndo: Change
newValue: String
aboutNode: Node
language: LanguageTag
oldValue: String
}

Expand All @@ -731,6 +770,7 @@ type RemoveTextDefinition
hasUndo: Change
newValue: String
aboutNode: Node
language: LanguageTag
oldValue: String
}

Expand All @@ -746,6 +786,7 @@ type RemovedNodeFromSubset implements RemoveFromSubset
hasUndo: Change
oldValue: String
newValue: String
language: LanguageTag
changeDescription: String
aboutNode: Node
subset: String
Expand All @@ -758,6 +799,23 @@ type Session
activitySet: [Activity]
}

type SetLanguageForName implements LanguageTagChange
{
id: String!
wasGeneratedBy: Activity
seeAlso: String
pullRequest: String
creator: String
changeDate: String
contributor: String
hasUndo: Change
aboutNode: Node
language: LanguageTag
oldValue: String
newValue: String
changeDescription: String
}

interface SimpleChange
{
id: String!
Expand Down Expand Up @@ -788,6 +846,7 @@ type SynonymPredicateChange
contributor: String
hasUndo: Change
aboutNode: Node
language: LanguageTag
oldValue: String
newValue: String
hasTextualDiff: TextualDiff
Expand All @@ -804,6 +863,7 @@ type SynonymReplacement
contributor: String
hasUndo: Change
aboutNode: Node
language: LanguageTag
oldValue: String
newValue: String
hasTextualDiff: TextualDiff
Expand All @@ -820,6 +880,7 @@ type TextDefinitionReplacement
contributor: String
hasUndo: Change
aboutNode: Node
language: LanguageTag
oldValue: String
newValue: String
hasTextualDiff: TextualDiff
Expand Down
Loading

0 comments on commit d5c31ee

Please sign in to comment.