move self to philosophy
All checks were successful
studiorailgun/trpg/pipeline/head This commit looks good

This commit is contained in:
austin 2024-12-30 15:29:13 -05:00
parent b740431717
commit aecfd4666c
7 changed files with 74 additions and 51 deletions

View File

@ -0,0 +1,9 @@
{
"tag" : "person",
"nodes" : {
"0" : {
"id" : 0,
"name" : "person"
}
}
}

View File

@ -0,0 +1,22 @@
{
"tag" : "self",
"nodes" : {
"0" : {
"id" : 0,
"name" : "self"
}
},
"relations" : {
"0" : {
"comment" : "The self is an instance of a person",
"id" : 0,
"name" : "instanceOf",
"parent" : 0,
"parentWeb" : "person",
"child" : 0
}
},
"anchors" : {
"self" : 0
}
}

View File

@ -1,6 +1,8 @@
{
"tag": "philosophy",
"dependencies" : [
"./data/webs/philosophy/concept.json"
"./data/webs/philosophy/concept.json",
"./data/webs/philosophy/person/person.json",
"./data/webs/philosophy/person/self.json"
]
}

View File

@ -16,8 +16,8 @@
"id" : 0,
"name" : "nameOf",
"parent" : 0,
"child" : 2,
"childWeb" : "root"
"child" : 0,
"childWeb" : "self"
},
"1" : {
"comment" : "The color of bert's hat is blue",
@ -39,8 +39,8 @@
"comment" : "The self possess bert's hat",
"id" : 3,
"name" : "possessionOf",
"parent" : 2,
"parentWeb" : "root",
"parent" : 0,
"parentWeb" : "self",
"child" : 9
},
"4" : {

View File

@ -28,8 +28,8 @@
"id" : 5,
"name" : "participantOf",
"parent" : 0,
"child" : 2,
"childWeb" : "root"
"child" : 0,
"childWeb" : "self"
}
},
"dependencies" : [

View File

@ -1,14 +1,6 @@
{
"tag" : "root",
"nodes" : {
"2" : {
"id" : 2,
"name" : "Self"
},
"3" : {
"id" : 3,
"name" : "Person"
},
"4" : {
"id" : 4,
"name" : "Other"
@ -19,18 +11,12 @@
}
},
"relations" : {
"1" : {
"comment" : "The self is an instance of a person",
"id" : 1,
"name" : "instanceOf",
"parent" : 3,
"child" : 2
},
"3" : {
"comment" : "The other is an instance of a person",
"id" : 3,
"name" : "instanceOf",
"parent" : 3,
"parent" : 0,
"parentWeb" : "person",
"child" : 4
},
"8" : {
@ -42,9 +28,6 @@
"child" : 8
}
},
"anchors" : {
"self" : 2
},
"dependencies" : [
"./data/webs/linguistics/linguistics.json",
"./data/webs/philosophy/philosophy.json",

View File

@ -164,29 +164,36 @@ public class AnchorNodes {
* @param tag The tag for the current web
*/
public void updateReferences(Map<String,Integer> crossRelationLookupMap, String tag){
if(this.getSelf() != null){
int oldId = this.getSelf();
String lookupId = "node-" + tag + oldId;
int newNodeId = crossRelationLookupMap.get(lookupId);
this.setSelf(newNodeId);
}
if(this.getConcept() != null){
int oldId = this.getConcept();
String lookupId = "node-" + tag + oldId;
int newNodeId = crossRelationLookupMap.get(lookupId);
this.setConcept(newNodeId);
}
if(this.getQualia() != null){
int oldId = this.getQualia();
String lookupId = "node-" + tag + oldId;
int newNodeId = crossRelationLookupMap.get(lookupId);
this.setQualia(newNodeId);
}
if(this.getName() != null){
int oldId = this.getName();
String lookupId = "node-" + tag + oldId;
int newNodeId = crossRelationLookupMap.get(lookupId);
this.setName(newNodeId);
int oldId;
String lookupId = null;
int newNodeId;
try {
if(this.getSelf() != null){
oldId = this.getSelf();
lookupId = "node-" + tag + oldId;
newNodeId = crossRelationLookupMap.get(lookupId);
this.setSelf(newNodeId);
}
if(this.getConcept() != null){
oldId = this.getConcept();
lookupId = "node-" + tag + oldId;
newNodeId = crossRelationLookupMap.get(lookupId);
this.setConcept(newNodeId);
}
if(this.getQualia() != null){
oldId = this.getQualia();
lookupId = "node-" + tag + oldId;
newNodeId = crossRelationLookupMap.get(lookupId);
this.setQualia(newNodeId);
}
if(this.getName() != null){
oldId = this.getName();
lookupId = "node-" + tag + oldId;
newNodeId = crossRelationLookupMap.get(lookupId);
this.setName(newNodeId);
}
} catch (NullPointerException ex){
throw new Error("Failed to find node link " + lookupId + " in relation in web " + tag);
}
}
@ -195,10 +202,10 @@ public class AnchorNodes {
*/
public void errorCheck(){
if(self == null){
throw new Error("Self undefined!");
throw new Error("self undefined!");
}
if(concept == null){
throw new Error("Concept undefined!");
throw new Error("concept undefined!");
}
}