move self to philosophy
All checks were successful
studiorailgun/trpg/pipeline/head This commit looks good
All checks were successful
studiorailgun/trpg/pipeline/head This commit looks good
This commit is contained in:
parent
b740431717
commit
aecfd4666c
9
data/webs/philosophy/person/person.json
Normal file
9
data/webs/philosophy/person/person.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"tag" : "person",
|
||||||
|
"nodes" : {
|
||||||
|
"0" : {
|
||||||
|
"id" : 0,
|
||||||
|
"name" : "person"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
data/webs/philosophy/person/self.json
Normal file
22
data/webs/philosophy/person/self.json
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"tag": "philosophy",
|
"tag": "philosophy",
|
||||||
"dependencies" : [
|
"dependencies" : [
|
||||||
"./data/webs/philosophy/concept.json"
|
"./data/webs/philosophy/concept.json",
|
||||||
|
"./data/webs/philosophy/person/person.json",
|
||||||
|
"./data/webs/philosophy/person/self.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -16,8 +16,8 @@
|
|||||||
"id" : 0,
|
"id" : 0,
|
||||||
"name" : "nameOf",
|
"name" : "nameOf",
|
||||||
"parent" : 0,
|
"parent" : 0,
|
||||||
"child" : 2,
|
"child" : 0,
|
||||||
"childWeb" : "root"
|
"childWeb" : "self"
|
||||||
},
|
},
|
||||||
"1" : {
|
"1" : {
|
||||||
"comment" : "The color of bert's hat is blue",
|
"comment" : "The color of bert's hat is blue",
|
||||||
@ -39,8 +39,8 @@
|
|||||||
"comment" : "The self possess bert's hat",
|
"comment" : "The self possess bert's hat",
|
||||||
"id" : 3,
|
"id" : 3,
|
||||||
"name" : "possessionOf",
|
"name" : "possessionOf",
|
||||||
"parent" : 2,
|
"parent" : 0,
|
||||||
"parentWeb" : "root",
|
"parentWeb" : "self",
|
||||||
"child" : 9
|
"child" : 9
|
||||||
},
|
},
|
||||||
"4" : {
|
"4" : {
|
||||||
|
|||||||
@ -28,8 +28,8 @@
|
|||||||
"id" : 5,
|
"id" : 5,
|
||||||
"name" : "participantOf",
|
"name" : "participantOf",
|
||||||
"parent" : 0,
|
"parent" : 0,
|
||||||
"child" : 2,
|
"child" : 0,
|
||||||
"childWeb" : "root"
|
"childWeb" : "self"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies" : [
|
"dependencies" : [
|
||||||
|
|||||||
@ -1,14 +1,6 @@
|
|||||||
{
|
{
|
||||||
"tag" : "root",
|
"tag" : "root",
|
||||||
"nodes" : {
|
"nodes" : {
|
||||||
"2" : {
|
|
||||||
"id" : 2,
|
|
||||||
"name" : "Self"
|
|
||||||
},
|
|
||||||
"3" : {
|
|
||||||
"id" : 3,
|
|
||||||
"name" : "Person"
|
|
||||||
},
|
|
||||||
"4" : {
|
"4" : {
|
||||||
"id" : 4,
|
"id" : 4,
|
||||||
"name" : "Other"
|
"name" : "Other"
|
||||||
@ -19,18 +11,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations" : {
|
"relations" : {
|
||||||
"1" : {
|
|
||||||
"comment" : "The self is an instance of a person",
|
|
||||||
"id" : 1,
|
|
||||||
"name" : "instanceOf",
|
|
||||||
"parent" : 3,
|
|
||||||
"child" : 2
|
|
||||||
},
|
|
||||||
"3" : {
|
"3" : {
|
||||||
"comment" : "The other is an instance of a person",
|
"comment" : "The other is an instance of a person",
|
||||||
"id" : 3,
|
"id" : 3,
|
||||||
"name" : "instanceOf",
|
"name" : "instanceOf",
|
||||||
"parent" : 3,
|
"parent" : 0,
|
||||||
|
"parentWeb" : "person",
|
||||||
"child" : 4
|
"child" : 4
|
||||||
},
|
},
|
||||||
"8" : {
|
"8" : {
|
||||||
@ -42,9 +28,6 @@
|
|||||||
"child" : 8
|
"child" : 8
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"anchors" : {
|
|
||||||
"self" : 2
|
|
||||||
},
|
|
||||||
"dependencies" : [
|
"dependencies" : [
|
||||||
"./data/webs/linguistics/linguistics.json",
|
"./data/webs/linguistics/linguistics.json",
|
||||||
"./data/webs/philosophy/philosophy.json",
|
"./data/webs/philosophy/philosophy.json",
|
||||||
|
|||||||
@ -164,29 +164,36 @@ public class AnchorNodes {
|
|||||||
* @param tag The tag for the current web
|
* @param tag The tag for the current web
|
||||||
*/
|
*/
|
||||||
public void updateReferences(Map<String,Integer> crossRelationLookupMap, String tag){
|
public void updateReferences(Map<String,Integer> crossRelationLookupMap, String tag){
|
||||||
if(this.getSelf() != null){
|
int oldId;
|
||||||
int oldId = this.getSelf();
|
String lookupId = null;
|
||||||
String lookupId = "node-" + tag + oldId;
|
int newNodeId;
|
||||||
int newNodeId = crossRelationLookupMap.get(lookupId);
|
try {
|
||||||
this.setSelf(newNodeId);
|
if(this.getSelf() != null){
|
||||||
}
|
oldId = this.getSelf();
|
||||||
if(this.getConcept() != null){
|
lookupId = "node-" + tag + oldId;
|
||||||
int oldId = this.getConcept();
|
newNodeId = crossRelationLookupMap.get(lookupId);
|
||||||
String lookupId = "node-" + tag + oldId;
|
this.setSelf(newNodeId);
|
||||||
int newNodeId = crossRelationLookupMap.get(lookupId);
|
}
|
||||||
this.setConcept(newNodeId);
|
if(this.getConcept() != null){
|
||||||
}
|
oldId = this.getConcept();
|
||||||
if(this.getQualia() != null){
|
lookupId = "node-" + tag + oldId;
|
||||||
int oldId = this.getQualia();
|
newNodeId = crossRelationLookupMap.get(lookupId);
|
||||||
String lookupId = "node-" + tag + oldId;
|
this.setConcept(newNodeId);
|
||||||
int newNodeId = crossRelationLookupMap.get(lookupId);
|
}
|
||||||
this.setQualia(newNodeId);
|
if(this.getQualia() != null){
|
||||||
}
|
oldId = this.getQualia();
|
||||||
if(this.getName() != null){
|
lookupId = "node-" + tag + oldId;
|
||||||
int oldId = this.getName();
|
newNodeId = crossRelationLookupMap.get(lookupId);
|
||||||
String lookupId = "node-" + tag + oldId;
|
this.setQualia(newNodeId);
|
||||||
int newNodeId = crossRelationLookupMap.get(lookupId);
|
}
|
||||||
this.setName(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(){
|
public void errorCheck(){
|
||||||
if(self == null){
|
if(self == null){
|
||||||
throw new Error("Self undefined!");
|
throw new Error("self undefined!");
|
||||||
}
|
}
|
||||||
if(concept == null){
|
if(concept == null){
|
||||||
throw new Error("Concept undefined!");
|
throw new Error("concept undefined!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user