From 4edcb7693fee221f4a30f58ea78d1b7c5cfca184 Mon Sep 17 00:00:00 2001 From: Himadri Date: Sat, 22 Jun 2019 17:10:06 +0200 Subject: [PATCH 01/66] create and rdf ontology graph component and display it in app component. --- ida-chatbot/src/app/app.component.html | 5 +++- ida-chatbot/src/app/app.module.ts | 4 ++- .../rdf-ontology-view.component.css | 0 .../rdf-ontology-view.component.html | 4 +++ .../rdf-ontology-view.component.spec.ts | 25 +++++++++++++++++++ .../rdf-ontology-view.component.ts | 23 +++++++++++++++++ 6 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css create mode 100644 ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html create mode 100644 ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.spec.ts create mode 100644 ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts diff --git a/ida-chatbot/src/app/app.component.html b/ida-chatbot/src/app/app.component.html index 63172031f..3d37e6305 100644 --- a/ida-chatbot/src/app/app.component.html +++ b/ida-chatbot/src/app/app.component.html @@ -4,9 +4,12 @@ [activeItem]="getActiveItem()">
+ + - + +
diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index bea7e9f59..b4c9ea014 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -60,6 +60,7 @@ import {DatatableDetailComponent} from './components/datatable-detail/datatable- import { SsbViewComponent } from './components/ssb-view/ssb-view.component'; import { VennViewComponent } from './components/venn-view/venn-view.component'; import { DeckglHexViewComponent } from './components/deckgl-hex-view/deckgl-hex-view.component'; +import { RdfOntologyViewComponent } from './components/rdf-ontology-view/rdf-ontology-view.component'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ @@ -80,7 +81,8 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; DatatableDetailComponent, SsbViewComponent, VennViewComponent, - DeckglHexViewComponent + DeckglHexViewComponent, + RdfOntologyViewComponent ], imports: [ BrowserModule, diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html new file mode 100644 index 000000000..729820374 --- /dev/null +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -0,0 +1,4 @@ +
+

RDF Ontology Class Hierarchy

+ RDF-ontology-class-hierarchy img +
diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.spec.ts b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.spec.ts new file mode 100644 index 000000000..eba53ee4c --- /dev/null +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RdfOntologyViewComponent } from './rdf-ontology-view.component'; + +describe('RdfOntologyViewComponent', () => { + let component: RdfOntologyViewComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RdfOntologyViewComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RdfOntologyViewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts new file mode 100644 index 000000000..c3094d29f --- /dev/null +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts @@ -0,0 +1,23 @@ +import { Component, OnInit} from '@angular/core'; +import {UniqueIdProviderService} from '../../service/misc/unique-id-provider.service'; + +@Component({ + selector: 'app-rdf-ontology-view', + templateUrl: './rdf-ontology-view.component.html', + styleUrls: ['./rdf-ontology-view.component.css'] +}) +export class RdfOntologyViewComponent implements OnInit { + + public figId: string; + public svgId: string; + public fileName: string; + + constructor(public uip: UniqueIdProviderService) { + this.figId = 'fig' + this.uip.getUniqueId(); + this.svgId = 'svg' + this.uip.getUniqueId(); + } + + ngOnInit() { + } + +} From 88c8af5d0d7169177e276550d82d63f04e7400a4 Mon Sep 17 00:00:00 2001 From: Himadri Date: Sat, 22 Jun 2019 17:40:37 +0200 Subject: [PATCH 02/66] read new data from RDF ontology json file and creation of nodes and links for class hierarchy --- ida-chatbot/src/app/app.component.html | 2 +- .../rdf-ontology-view.component.html | 2 +- .../rdf-ontology-view.component.ts | 14 +- .../d3v4-rdf-ontology-graph-view.js | 227 ++++ .../rdfontology/historian-onlogoly.json | 1172 +++++++++++++++++ ida-chatbot/src/index.html | 1 + 6 files changed, 1414 insertions(+), 4 deletions(-) create mode 100644 ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js create mode 100644 ida-chatbot/src/assets/rdfontology/historian-onlogoly.json diff --git a/ida-chatbot/src/app/app.component.html b/ida-chatbot/src/app/app.component.html index 3d37e6305..8663a155c 100644 --- a/ida-chatbot/src/app/app.component.html +++ b/ida-chatbot/src/app/app.component.html @@ -9,7 +9,7 @@ - + diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index 729820374..d83608137 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -1,4 +1,4 @@

RDF Ontology Class Hierarchy

- RDF-ontology-class-hierarchy img +
RDF-ontology-class-hierarchy img
diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts index c3094d29f..c9fd118a4 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts @@ -1,6 +1,7 @@ -import { Component, OnInit} from '@angular/core'; +import { Component, OnInit,AfterViewInit,} from '@angular/core'; import {UniqueIdProviderService} from '../../service/misc/unique-id-provider.service'; +declare function createV4RDFOntologyGraph(a, b,c); @Component({ selector: 'app-rdf-ontology-view', templateUrl: './rdf-ontology-view.component.html', @@ -19,5 +20,14 @@ export class RdfOntologyViewComponent implements OnInit { ngOnInit() { } - + ngAfterViewInit() { + + //const svg = d3.select('#' + this.fdgid); + this.fileName = ""; + console.log("before calling "); + //createV4RDFOntologyClasshierarchy(this.figId, this.svgId,this.fileName); + createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName); + console.log("After calling "); + //createV4RDFOntologyGraphtest(this.figId2, this.svgId2,this.fileName); + } } diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js new file mode 100644 index 000000000..369164549 --- /dev/null +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -0,0 +1,227 @@ +function createV4RDFOntologyGraph(figId, svgId, fileName,) { + var linksArray = []; + var nodesArray = []; + + var width = 1060,height = 900; + + + var svg = d3.select("#"+svgId) + .append("svg") + .attr("width", width) + .attr("height", height); + + svg.append("svg:defs").selectAll("marker") + .data(["end"]) + .enter().append("svg:marker") + .attr("id", String) + .attr("viewBox", "0 -5 15 15") + .attr("refX", 30) + .attr("refY", -0.5) + .attr("markerWidth", 26) + .attr("markerHeight", 6) + .attr("orient", "auto") + .append("svg:polyline") + .attr("points", "0,-5 10,0 0,5") + ; + + + var color = d3.scaleOrdinal(d3.schemeCategory20); + + var simulation = d3.forceSimulation() + .force("link", d3.forceLink().id(function(d) { return d.id; }).distance(50)) + .force("charge", d3.forceManyBody().strength(-1000)) //Charge strength is here + .force("center", d3.forceCenter((width / 2), (height / 2))); + + d3.json("assets/rdfontology/historian-onlogoly.json", function(error, data) + { + var literalIndex = 0; + var circleIdIndex = 0; + data["@graph"].forEach(function(element) + { + var tempSub =""; + var tempPred =""; + var tempObj =""; + var pred="---subClassOf---"; + var tempDomainArray = []; + //START :: Nodes and Links creation for subClassOf + if(element["rdfs:subClassOf"] != undefined) + { + + var tempLabelArray = element["@id"].split('/'); + tempSub = tempLabelArray[tempLabelArray.length -1 ]; + + if(Object.prototype.toString.call(element["rdfs:subClassOf"]) === '[object Array]') + { + element["rdfs:subClassOf"].forEach(function(eachIds) + { + var tempLabelArray = eachIds["@id"].split('/'); + tempObj = tempLabelArray[tempLabelArray.length -1 ]; + + var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; + linksArray.push(tripleValue); + createNewNode(tempSub,pred,tempObj); + }); + } + else + { + var tempLabelArray = element["rdfs:subClassOf"]["@id"].split('/'); + tempObj = tempLabelArray[tempLabelArray.length -1 ]; + var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; + linksArray.push(tripleValue); + + createNewNode(tempSub,pred,tempObj); + } + + } + //END :: Nodes and Links creation for subClassOf + + }); + + if (error) { + return console.warn('Error in createV3RDFOntologyGraphView() method :'+error); + } + + var g = svg.append("g") + .attr("class", "everything"); + + var link = g.append("g") + .attr("class", "links") + .selectAll("line") + .data(linksArray) + .enter().append("line") + .attr("class", "link") + .attr("stroke-width",1) + .style("fill","#999") + .attr("marker-end", "url(#end)") + .style("stroke-dasharray",function (d) {return ("0, 0");}) + ; + + // ==================== Add Link Names ===================== + var linkTexts = g.selectAll(".link-text") + .data(linksArray) + .enter() + .append("text") + .attr("class", "link-text") + .text( function (d) { + //console.log(d); + return d.predicate; }) + .style("fill",function(d){return "#28B463";}) + .style("font-size", "80%") + .style("font-style", "italic") + .attr('x', 12) + .attr('y', 3) + ; + // ==================== Add Link Names ===================== + + var node = g.append("g") + .attr("class", "nodes") + .selectAll("g") + .data(nodesArray) + .enter().append("g") + ; + var circles = node.append("circle") + .attr("id",function(d){return d.nodeId ;}) + .attr("r","8") + .style("fill",function(d){ return "#311B92";}) + .call(d3.drag() + .on("start", dragstarted) + .on("drag", dragged) + .on("end", dragended) + ); + + var lables = node.append("text") + .attr("class", "node-text") + .text(function (d) { return d.id; }) + .style("font-size","100%") + .style("fill","#311B92") + .attr('x', 12) + .attr('y', 3) + ; + + simulation + .nodes(nodesArray) + .on("tick", ticked) + ; + + simulation.force("link") + .links(linksArray) + ; + + function ticked() + { + lables + .attr("x2", function(d){ return d.x-width; }) + .attr("y2", function (d) {return d.y -height; }) + ; + link + .attr("x1", function(d) { return d.source.x; }) + .attr("y1", function(d) { return d.source.y; }) + .attr("x2", function(d) { return d.target.x; }) + .attr("y2", function(d) { return d.target.y; }) + ; + linkTexts + .attr("x", function(d) { //return Math.max(5, Math.min(width - 10, (d.source.x + d.target.x)/2 )); + return 4 + (d.source.x + d.target.x)/2 ; }) + .attr("y", function(d) { + return 4 + (d.source.y + d.target.y)/2 ; }) + ; + node + .attr("transform", function(d) { + return "translate(" + d.x + "," + d.y + ")"; + }) + ; + } + + function createNewNode(tempSub,tempPred,tempObj) + { + //START :: Node creation + var subNodeAdded = false; + var objNodeAdded = false; + + if(nodesArray != undefined) + { + nodesArray.forEach(function(elem) + { + if(elem["id"] === tempSub) + { + subNodeAdded = true; + } + if(elem["id"] === tempObj) + { + objNodeAdded = true; + } + }); + } + + if(subNodeAdded === false) + { + var nodeValue = {id:tempSub ,predicate:tempPred, group: 1}; + nodesArray.push(nodeValue); + } + if(objNodeAdded === false) + { + var nodeValue = {id:tempObj ,predicate:tempPred, group: 1}; + nodesArray.push(nodeValue); + } + //END :: Node creation + //console.log("nodeValue len =>"+nodesArray.length); + } + }); + + function dragstarted(d) { + if (!d3.event.active) simulation.alphaTarget(0.3).restart(); + d.fx = d.x; + d.fy = d.y; + } + + function dragged(d) { + d.fx = d3.event.x; + d.fy = d3.event.y; + } + + function dragended(d) { + if (!d3.event.active) simulation.alphaTarget(0); + d.fx = null; + d.fy = null; + } +}; diff --git a/ida-chatbot/src/assets/rdfontology/historian-onlogoly.json b/ida-chatbot/src/assets/rdfontology/historian-onlogoly.json new file mode 100644 index 000000000..dcc8f7ad7 --- /dev/null +++ b/ida-chatbot/src/assets/rdfontology/historian-onlogoly.json @@ -0,0 +1,1172 @@ +{ + "@context": { + "data": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/data/", + "dbo": "http://dbpedia.org/ontology/", + "dc": "http://purl.org/dc/elements/1.1/", + "foaf": "http://xmlns.com/foaf/0.1/", + "owl": "http://www.w3.org/2002/07/owl#", + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "time": "http://www.w3.org/2006/time#", + "xsd": "http://www.w3.org/2001/XMLSchema#" + }, + "@graph": [ + { + "@id": "dbo:deathPlace", + "@type": "owl:DatatypeProperty" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierLiteratureInfo", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "en", + "@value": "SoldierLiteratureInfo" + }, + { + "@language": "de", + "@value": "SoldatenLiteratur Info" + } + ], + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Timestampable" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + } + ] + }, + { + "@id": "time:hasBeginning", + "@type": "owl:DatatypeProperty", + "rdfs:comment": "Describes the beginning time of a temporal entity", + "rdfs:label": { + "@language": "en", + "@value": "startsAt" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Decoration", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "de", + "@value": "Orden" + }, + { + "@language": "en", + "@value": "Decoration" + } + ], + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Abbreviable" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Timeframable" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + } + ] + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/NSDAPFunctionInfo", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierNSDAPFunctionInfo" + }, + "rdfs:label": { + "@language": "en", + "@value": "NSDAPFunctionInfo" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/listPageNumber", + "@type": [ + "owl:FunctionalProperty", + "owl:DatatypeProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierLiteratureInfo" + }, + "rdfs:label": { + "@language": "en", + "@value": "listPageNumber" + }, + "rdfs:range": { + "@id": "xsd:positiveInteger" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierNSDAPFunctionInfo", + "@type": "owl:Class", + "rdfs:label": { + "@language": "en", + "@value": "SoldierNSDAPFunctionInfo" + }, + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Timestampable" + } + ] + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/author", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Literature" + }, + "rdfs:label": { + "@language": "en", + "@value": "author" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/hasRegiment", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierRegimentInfo" + }, + "rdfs:label": { + "@language": "en", + "@value": "hasRegiment" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Regiment" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/hasSSRank", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierSSRankInfo" + }, + "rdfs:label": { + "@language": "en", + "@value": "hasSSRank" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSRank" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSRank", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "de", + "@value": "SSRang" + }, + { + "@language": "en", + "@value": "SSRank" + } + ], + "rdfs:subClassOf": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Dischargable", + "@type": "owl:Class", + "dc:description": { + "@language": "en", + "@value": "Describes the entity which can be discharged with a reason i.e. Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "Dischargable" + }, + "rdfs:subClassOf": { + "@id": "owl:Thing" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/applicableFrom", + "@type": [ + "owl:FunctionalProperty", + "owl:DatatypeProperty" + ], + "rdfs:comment": "Date on which a Soldier was given a Medal/Decoration.", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Timestampable" + }, + "rdfs:label": { + "@language": "en", + "@value": "applicableFrom" + }, + "rdfs:range": { + "@id": "xsd:dateTime" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/internalInformation", + "@type": [ + "owl:DatatypeProperty", + "owl:FunctionalProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + "rdfs:label": { + "@language": "en", + "@value": "internalInformation" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/name", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + "rdfs:label": { + "@language": "en", + "@value": "name" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/dataDifference", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "Difference from DAL" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/enrolledOn", + "@type": [ + "owl:DatatypeProperty", + "owl:FunctionalProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "enrolledOn" + }, + "rdfs:range": { + "@id": "xsd:dateTime" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/citaviId", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Literature" + }, + "rdfs:label": { + "@language": "en", + "@value": "Citavi Database Id" + }, + "rdfs:range": { + "@id": "xsd:positiveInteger" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/origin", + "@type": "owl:DatatypeProperty", + "rdfs:comment": "Origin of the Literature", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Literature" + }, + "rdfs:label": { + "@language": "en", + "@value": "Origin" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/dischargeReason", + "@type": [ + "owl:DatatypeProperty", + "owl:FunctionalProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Dischargable" + }, + "rdfs:label": { + "@language": "en", + "@value": "dischargeReason" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "time:TemporalEntity", + "@type": "owl:Class" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/verifiedData", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "Data verified on DAL?" + }, + "rdfs:range": { + "@id": "xsd:boolean" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierGovernmentFunctionInfo", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "de", + "@value": "Soldatenregierungsfunktion Info" + }, + { + "@language": "en", + "@value": "SoldierGovernmentFunctionInfo" + } + ], + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Timestampable" + } + ] + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/dischargedOn", + "@type": [ + "owl:FunctionalProperty", + "owl:DatatypeProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "dischargedOn" + }, + "rdfs:range": { + "@id": "xsd:dateTime" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "dbo:lastName", + "@type": "owl:DatatypeProperty" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/literatureInfo", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierLiteratureInfo" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/hasLiterature", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierLiteratureInfo" + }, + "rdfs:label": { + "@language": "en", + "@value": "hasLiterature" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Literature" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass", + "@type": "owl:Class", + "dc:description": { + "@language": "en", + "@value": "Top level resource of SS Ontology" + }, + "rdfs:label": { + "@language": "en", + "@value": "SSClass" + }, + "rdfs:subClassOf": { + "@id": "owl:Thing" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/enrollmentReason", + "@type": [ + "owl:DatatypeProperty", + "owl:FunctionalProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "enrollmentReason" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/NSDAPFunction", + "@type": "owl:Class", + "rdfs:label": { + "@language": "en", + "@value": "NSDAPFunction" + }, + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Abbreviable" + } + ] + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierDischargeInfo", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "de", + "@value": "Soldatenentlassung Info" + }, + { + "@language": "en", + "@value": "SoldierDischargeInfo" + } + ], + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Dischargable" + } + ] + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Literature", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "de", + "@value": "Literatur" + }, + { + "@language": "en", + "@value": "Literature" + } + ], + "rdfs:subClassOf": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/information", + "@type": [ + "owl:FunctionalProperty", + "owl:DatatypeProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + "rdfs:label": { + "@language": "en", + "@value": "information" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/signature", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Literature" + }, + "rdfs:label": { + "@language": "en", + "@value": "signature" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "dbo:birthPlace", + "@type": "owl:DatatypeProperty" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/publicationYear", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Literature" + }, + "rdfs:label": { + "@language": "en", + "@value": "publicationYear" + }, + "rdfs:range": { + "@id": "xsd:positiveInteger" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/governmentFunctionInfo", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierGovernmentFunctionInfo" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/deathDate", + "@type": [ + "owl:DatatypeProperty", + "owl:FunctionalProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "deathDate" + }, + "rdfs:range": { + "@id": "xsd:dateTime" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSRankInfo", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierSSRankInfo" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/GovernmentFunction", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "en", + "@value": "GovernmentFunction" + }, + { + "@language": "de", + "@value": "Regierungsfunktion" + } + ], + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Abbreviable" + } + ] + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/regimentInfo", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierRegimentInfo" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/sortation", + "@type": [ + "owl:FunctionalProperty", + "owl:DatatypeProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSRank" + }, + "rdfs:label": { + "@language": "en", + "@value": "sortation" + }, + "rdfs:range": { + "@id": "xsd:positiveInteger" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/membershipNumber", + "@type": [ + "owl:DatatypeProperty", + "owl:FunctionalProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "membershipNumber" + }, + "rdfs:range": { + "@id": "xsd:positiveInteger" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/hasNSDAPFunction", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierNSDAPFunctionInfo" + }, + "rdfs:label": { + "@language": "en", + "@value": "hasNSDAPFunction" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/NSDAPFunction" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/birthDate", + "@type": [ + "owl:FunctionalProperty", + "owl:DatatypeProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "birthDate" + }, + "rdfs:range": { + "@id": "xsd:dateTime" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "de", + "@value": "Soldat" + }, + { + "@language": "en", + "@value": "Soldier" + } + ], + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Dischargable" + }, + { + "@id": "dbo:Person" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + } + ] + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/id", + "@type": [ + "owl:FunctionalProperty", + "owl:DatatypeProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + "rdfs:label": { + "@language": "en", + "@value": "id" + }, + "rdfs:range": { + "@id": "xsd:positiveInteger" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/hasTitle", + "@type": [ + "owl:DatatypeProperty", + "owl:FunctionalProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "hasTitle" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/title", + "@type": [ + "owl:FunctionalProperty", + "owl:DatatypeProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "title" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierRegimentInfo", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "de", + "@value": "Soldatendienststellung Info" + }, + { + "@language": "en", + "@value": "SoldierRegimentInfo" + } + ], + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Timestampable" + } + ] + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/originalSoldierId", + "@type": [ + "owl:FunctionalProperty", + "owl:DatatypeProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierLiteratureInfo" + }, + "rdfs:label": { + "@language": "en", + "@value": "originalSoldierId" + }, + "rdfs:range": { + "@id": "xsd:positiveInteger" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/hasDischargeInfo", + "@type": [ + "owl:ObjectProperty", + "owl:FunctionalProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierDischargeInfo" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/abbreviation", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Abbreviable" + }, + "rdfs:label": { + "@language": "en", + "@value": "abbreviation" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/", + "@type": "owl:Ontology", + "dc:description": { + "@language": "en", + "@value": "Vocabulary describing Concepts and Relationships of Schutzstaffel" + }, + "dc:title": { + "@language": "en", + "@value": "SS Vocabulary" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/membershipType", + "@type": [ + "owl:DatatypeProperty", + "owl:FunctionalProperty" + ], + "rdfs:comment": "XML has no occurence of this column.", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "membershipType" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/status", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Literature" + }, + "rdfs:label": { + "@language": "en", + "@value": "processing status" + }, + "rdfs:range": { + "@id": "xsd:string" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "dbo:Person", + "@type": "owl:Class" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/hasDecoration", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/DecorationEvent" + }, + "rdfs:label": { + "@language": "en", + "@value": "hasDecoration" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Decoration" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/NSDAPNumber", + "@type": [ + "owl:DatatypeProperty", + "owl:FunctionalProperty" + ], + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:label": { + "@language": "en", + "@value": "NSDAP Number" + }, + "rdfs:range": { + "@id": "xsd:positiveInteger" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topDataProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Timestampable", + "@type": "owl:Class", + "dc:description": { + "@language": "en", + "@value": "Describes a specific point in time" + }, + "rdfs:label": { + "@language": "en", + "@value": "Timestampable" + }, + "rdfs:subClassOf": { + "@id": "owl:Thing" + } + }, + { + "@id": "time:hasEnd", + "@type": "owl:DatatypeProperty", + "rdfs:comment": "Describes the ending time of a temporal entity", + "rdfs:label": { + "@language": "en", + "@value": "endsAt" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/decorationInfo", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Soldier" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/DecorationEvent" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/hasGovernmentFunction", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierGovernmentFunctionInfo" + }, + "rdfs:label": { + "@language": "en", + "@value": "hasGovernmentFunction" + }, + "rdfs:range": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/GovernmentFunction" + }, + "rdfs:subPropertyOf": { + "@id": "owl:topObjectProperty" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Timeframable", + "@type": "owl:Class", + "dc:description": { + "@language": "en", + "@value": "Describes temporal entities, i.e with a beginning and end in time" + }, + "rdfs:label": { + "@language": "en", + "@value": "Timeframable" + }, + "rdfs:subClassOf": { + "@id": "time:TemporalEntity" + } + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Abbreviable", + "@type": "owl:Class", + "dc:description": { + "@language": "en", + "@value": "Describes entities which have an abbreviated name" + }, + "rdfs:label": { + "@language": "en", + "@value": "Abbreviable" + }, + "rdfs:subClassOf": { + "@id": "owl:Thing" + } + }, + { + "@id": "dc:description", + "@type": "owl:AnnotationProperty" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/DecorationEvent", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "en", + "@value": "DecorationEvent" + }, + { + "@language": "de", + "@value": "Soldatendekoration Info" + } + ], + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Timestampable" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + } + ] + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Regiment", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "de", + "@value": "Dienststellung" + }, + { + "@language": "en", + "@value": "Regiment" + } + ], + "rdfs:subClassOf": [ + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/Abbreviable" + } + ] + }, + { + "@id": "dc:title", + "@type": "owl:AnnotationProperty" + }, + { + "@id": "dbo:firstName", + "@type": "owl:DatatypeProperty" + }, + { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SoldierSSRankInfo", + "@type": "owl:Class", + "rdfs:label": [ + { + "@language": "de", + "@value": "Soldat SS Rang Info" + }, + { + "@language": "en", + "@value": "Soldier SS Rank Info" + } + ], + "rdfs:subClassOf": { + "@id": "https://www.upb.de/historisches-institut/neueste-geschichte/ssdal/ontology/SSClass" + } + } + ] +} \ No newline at end of file diff --git a/ida-chatbot/src/index.html b/ida-chatbot/src/index.html index b0fd08625..e202a8799 100644 --- a/ida-chatbot/src/index.html +++ b/ida-chatbot/src/index.html @@ -15,6 +15,7 @@ + From aada811cf90b7d9ef532124254585e8a7386effe Mon Sep 17 00:00:00 2001 From: Himadri Date: Sat, 22 Jun 2019 17:44:49 +0200 Subject: [PATCH 03/66] read new data from RDF ontology json file and creation of nodes and links for class hierarchy --- .../rdf-ontology-view/rdf-ontology-view.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index d83608137..f478ed099 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -1,4 +1,4 @@
-

RDF Ontology Class Hierarchy

+

RDF Ontology Class Hierarchy

RDF-ontology-class-hierarchy img
From 9301d63e32f62edaa5068b78af15b839a295e2e3 Mon Sep 17 00:00:00 2001 From: Himadri Date: Sat, 22 Jun 2019 18:41:39 +0200 Subject: [PATCH 04/66] checking logs..ignore commit --- ida-chatbot/src/app/app.module.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index b4c9ea014..2319bd029 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -61,7 +61,7 @@ import { SsbViewComponent } from './components/ssb-view/ssb-view.component'; import { VennViewComponent } from './components/venn-view/venn-view.component'; import { DeckglHexViewComponent } from './components/deckgl-hex-view/deckgl-hex-view.component'; import { RdfOntologyViewComponent } from './components/rdf-ontology-view/rdf-ontology-view.component'; -import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +//import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ declarations: [ @@ -123,8 +123,8 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; MatTabsModule, MatToolbarModule, MatTooltipModule, - FlexLayoutModule, - NgbModule + FlexLayoutModule//, + // NgbModule ], providers: [{ provide: HTTP_INTERCEPTORS, From 09441fa7b33d6d0761b2e98503cabfbb7b2fcea2 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Mon, 24 Jun 2019 12:52:32 +0200 Subject: [PATCH 05/66] test commit --- ida-chatbot/src/app/components/rdf-ontology-view/test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 ida-chatbot/src/app/components/rdf-ontology-view/test.txt diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/test.txt b/ida-chatbot/src/app/components/rdf-ontology-view/test.txt new file mode 100644 index 000000000..8baef1b4a --- /dev/null +++ b/ida-chatbot/src/app/components/rdf-ontology-view/test.txt @@ -0,0 +1 @@ +abc From adc98d8fe4da6b3ca8227525c93d5c2b40d5fa0e Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Mon, 24 Jun 2019 13:05:32 +0200 Subject: [PATCH 06/66] test commit --- ida-chatbot/src/app/components/rdf-ontology-view/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/test.txt b/ida-chatbot/src/app/components/rdf-ontology-view/test.txt index 8baef1b4a..6fede0913 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/test.txt +++ b/ida-chatbot/src/app/components/rdf-ontology-view/test.txt @@ -1 +1 @@ -abc +abc1 From f1f752372b99f0dbd8a30ba2e6cf1b84a4d439c8 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Tue, 25 Jun 2019 16:05:51 +0200 Subject: [PATCH 07/66] 1. creation of nodes and links for all properties. 2. implement on hover 3. diffterent colors for diferent types of nodes, edges label. 4. implement filter tab. 5. implement duestch conversion. 6. implement add class hierarch and all properties into filter tab. --- .../rdf-ontology-view.component.css | 17 + .../rdf-ontology-view.component.html | 22 ++ .../rdf-ontology-view.component.ts | 19 +- .../app/components/rdf-ontology-view/test.txt | 1 - .../d3v4-rdf-ontology-graph-view.js | 326 +++++++++++++++--- 5 files changed, 331 insertions(+), 54 deletions(-) delete mode 100644 ida-chatbot/src/app/components/rdf-ontology-view/test.txt diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css index e69de29bb..51892118d 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css @@ -0,0 +1,17 @@ +.labelClass { + + padding-left: 20px; + text-indent: -15px; + padding-top: 7px; + font-size: 19px; + } +.checkboxClass { + width: 20px; + height: 20px; + padding-top: 10px; + margin:0; + vertical-align: bottom; + position: relative; + top: -8px; + *overflow: hidden; + } \ No newline at end of file diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index f478ed099..b716ff230 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -1,3 +1,25 @@ +
+ + + + + +
+

RDF Ontology Class Hierarchy

RDF-ontology-class-hierarchy img
diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts index c9fd118a4..a2c73c6c3 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit,AfterViewInit,} from '@angular/core'; import {UniqueIdProviderService} from '../../service/misc/unique-id-provider.service'; -declare function createV4RDFOntologyGraph(a, b,c); +declare function createV4RDFOntologyGraph(a, b,c,d,e,f); @Component({ selector: 'app-rdf-ontology-view', templateUrl: './rdf-ontology-view.component.html', @@ -12,7 +12,10 @@ export class RdfOntologyViewComponent implements OnInit { public figId: string; public svgId: string; public fileName: string; - + languageCheked = false; + classHeirarchyChecked = true; + allPropChecked = false; + constructor(public uip: UniqueIdProviderService) { this.figId = 'fig' + this.uip.getUniqueId(); this.svgId = 'svg' + this.uip.getUniqueId(); @@ -21,13 +24,11 @@ export class RdfOntologyViewComponent implements OnInit { ngOnInit() { } ngAfterViewInit() { - - //const svg = d3.select('#' + this.fdgid); this.fileName = ""; - console.log("before calling "); - //createV4RDFOntologyClasshierarchy(this.figId, this.svgId,this.fileName); - createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName); - console.log("After calling "); - //createV4RDFOntologyGraphtest(this.figId2, this.svgId2,this.fileName); + createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked,this.allPropChecked); + } + + checkboxValuesChanged(event: any){ + createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked,this.allPropChecked); } } diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/test.txt b/ida-chatbot/src/app/components/rdf-ontology-view/test.txt deleted file mode 100644 index 6fede0913..000000000 --- a/ida-chatbot/src/app/components/rdf-ontology-view/test.txt +++ /dev/null @@ -1 +0,0 @@ -abc1 diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index 369164549..adb4fa19e 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -1,10 +1,14 @@ -function createV4RDFOntologyGraph(figId, svgId, fileName,) { +function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displaySubclasses,dispalyAllprop,) { var linksArray = []; var nodesArray = []; + var enLabelArray = []; + var deLabelArray = []; - var width = 1060,height = 900; - + var width = 1000,height = 900; + var svgClear = d3.select("#"+svgId); + svgClear.selectAll("*").remove(); + var svg = d3.select("#"+svgId) .append("svg") .attr("width", width) @@ -12,7 +16,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,) { svg.append("svg:defs").selectAll("marker") .data(["end"]) - .enter().append("svg:marker") + .enter().append("svg:marker") .attr("id", String) .attr("viewBox", "0 -5 15 15") .attr("refX", 30) @@ -34,49 +38,214 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,) { d3.json("assets/rdfontology/historian-onlogoly.json", function(error, data) { + //START :: get english and deutsch labels values into arrays + data["@graph"].forEach(function(elem) + { + if(elem["rdfs:label"] != undefined) + { + if(Object.prototype.toString.call(elem["rdfs:label"]) === '[object Array]') + { + elem["rdfs:label"].forEach(function(eachIds) + { + if(eachIds["@language"] == "de") + { + var tempLabel = {"id":elem["@id"],"language":"de","value":eachIds["@value"]} + deLabelArray.push(tempLabel); + } + if(eachIds["@language"] == "en") + { + var tempLabel = {"id":elem["@id"],"language":"en","value":eachIds["@value"]} + enLabelArray.push(tempLabel); + } + + }); + } + else + { + if(elem["rdfs:label"]["@language"] == "de") + { + var tempLabel = {"id":elem["@id"],"language":"de","value":elem["rdfs:label"]["@value"]} + deLabelArray.push(tempLabel); + } + if(elem["rdfs:label"]["@language"] == "en") + { + var tempLabel = {"id":elem["@id"],"language":"en","value":elem["rdfs:label"]["@value"]} + enLabelArray.push(tempLabel); + } + } + } + + }); + //END :: get english and deutch labels values into arrays + + //START :: Creation of Graph depenging on displaySubclasses and dispalyAllprop values var literalIndex = 0; var circleIdIndex = 0; data["@graph"].forEach(function(element) { - var tempSub =""; - var tempPred =""; - var tempObj =""; + var tempSub ="?"; + var tempPred ="?"; + var tempObj ="?"; var pred="---subClassOf---"; var tempDomainArray = []; //START :: Nodes and Links creation for subClassOf - if(element["rdfs:subClassOf"] != undefined) + if(displaySubclasses) { - - var tempLabelArray = element["@id"].split('/'); - tempSub = tempLabelArray[tempLabelArray.length -1 ]; - - if(Object.prototype.toString.call(element["rdfs:subClassOf"]) === '[object Array]') - { - element["rdfs:subClassOf"].forEach(function(eachIds) - { - var tempLabelArray = eachIds["@id"].split('/'); - tempObj = tempLabelArray[tempLabelArray.length -1 ]; - - var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; - linksArray.push(tripleValue); - createNewNode(tempSub,pred,tempObj); - }); - } - else - { - var tempLabelArray = element["rdfs:subClassOf"]["@id"].split('/'); - tempObj = tempLabelArray[tempLabelArray.length -1 ]; - var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; - linksArray.push(tripleValue); + if(element["rdfs:subClassOf"] != undefined) + { + tempSub = getLabel(displayDeustch,element["@id"]); + if(tempSub == "noLabel") + { + var tempLabelArray = element["@id"].split('/'); + tempSub = tempLabelArray[tempLabelArray.length -1 ]+'?'; + } - createNewNode(tempSub,pred,tempObj); - } - + if(Object.prototype.toString.call(element["rdfs:subClassOf"]) === '[object Array]') + { + element["rdfs:subClassOf"].forEach(function(eachIds) + { + tempObj = getLabel(displayDeustch,eachIds["@id"]); + if(tempObj == "noLabel") + { + var tempLabelArray = eachIds["@id"].split('/'); + tempObj = tempLabelArray[tempLabelArray.length -1 ]+'?'; + } + + var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; + linksArray.push(tripleValue); + createNewNode(tempSub,pred,tempObj); + }); + } + else + { + tempObj = getLabel(displayDeustch,element["rdfs:subClassOf"]["@id"]); + if(tempObj == "noLabel") + { + var tempLabelArray = element["rdfs:subClassOf"]["@id"].split('/'); + tempObj = tempLabelArray[tempLabelArray.length -1 ]+'?'; + } + //var tripleValue = {source:tempSub, predicate:'---subClassOf---', target:tempObj,value: 1}; + var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; + linksArray.push(tripleValue); + + //createNewNode(tempSub,'---subClassOf---',tempObj); + createNewNode(tempSub,pred,tempObj); + } + + } } //END :: Nodes and Links creation for subClassOf + + //START :: Nodes and Links creation for all Properties + if(dispalyAllprop) + { + //get the subject label + if(element["rdfs:domain"]!=undefined) + { + if(Object.prototype.toString.call(element["rdfs:domain"]) === '[object Array]'){ + //console.log("inside if"); + element["rdfs:domain"].forEach(function(eachIds) + { + var tempDomainLabel = getLabel(displayDeustch,eachIds["@id"]); + if(tempDomainLabel == "noLabel") + { + var tempLabelArray = eachIds["@id"].split('/'); + tempDomainLabel = tempLabelArray[tempLabelArray.length -1 ]+'?'; + } + tempDomainArray.push(tempDomainLabel); + }); + } + else + { + tempSub = getLabel(displayDeustch,element["rdfs:domain"]["@id"]); + if(tempSub == "noLabel") + { + var tempLabelArray = element["rdfs:domain"]["@id"].split('/'); + tempSub = tempLabelArray[tempLabelArray.length -1 ]+'?'; + } + } + } + + //get the predicate + if(element["rdfs:domain"]!=undefined) + { + tempPred = getLabel(displayDeustch,element["@id"]); + if(tempPred == "noLabel") + { + var tempLabelArray = element["@id"].split('/'); + tempPred = tempLabelArray[tempLabelArray.length -1 ]+'?'; + } + } + + + //get the object range + if(element["rdfs:range"]!=undefined){ + //console.log(element.domain["@id"]); + if ("@id" in element["rdfs:range"]) + { + tempObj = getLabel(displayDeustch,element["rdfs:range"]["@id"]); + if(tempObj == "noLabel") + { + var tempLabelArray = element["rdfs:range"]["@id"].split('/'); + tempObj = tempLabelArray[tempLabelArray.length -1 ]+'?'; + } + } + } + + if(tempObj.toLowerCase().includes("string") || tempObj.toLowerCase().includes("boolean")|| tempObj.toLowerCase().includes("integer") || tempObj.toLowerCase().includes("date") || tempObj.toLowerCase().includes("time")) + { + tempObj = tempObj + literalIndex; + literalIndex = literalIndex + 1 ; + } + + if(!tempDomainArray.length ==0) + { + tempDomainArray.forEach(function(el) + { + if(el != "?" && tempPred != "?" && tempObj != "?") + { + var tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; + linksArray.push(tripleValue); + createNewNode(el,tempPred,tempObj); + } + }); + } + else + { + if(tempSub != "?" && tempPred != "?" && tempObj != "?") + { + var tripleValue = {source:tempSub, predicate:tempPred, target:tempObj,value: 1}; + linksArray.push(tripleValue); + createNewNode(tempSub,tempPred,tempObj); + } + } + } + //END :: Nodes and Links creation for all Properties + /* + if(element.subPropertyOf != undefined){ + tempSub = element.label.value; + + tempObj = element.subPropertyOf["@id"]; + data["@graph"].forEach(function(elem) { + //console.log(elem["@id"]); + if(elem["@id"] == element.subPropertyOf["@id"]){ + if(elem.label != undefined){ + + tempObj = elem.label.value; + //console.log("elem.label.value => "+elem.label.value); + } + } + }); + var tripleValue = {subject:tempSub, predicate:'---subPropertyOf---', object:tempObj}; + triples.push(tripleValue); + + } + */ + //} }); - + //END :: Creation of Graph depenging on displaySubclasses and dispalyAllprop values + if (error) { return console.warn('Error in createV3RDFOntologyGraphView() method :'+error); } @@ -93,7 +262,12 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,) { .attr("stroke-width",1) .style("fill","#999") .attr("marker-end", "url(#end)") - .style("stroke-dasharray",function (d) {return ("0, 0");}) + .style("stroke-dasharray",function (d) { + var labelStr = d.predicate; + if(labelStr.includes('subClassOf')){return ("3, 3");} + if(labelStr.includes('subPropertyOf')){return ("5, 5");} + return ("0, 0");}) + ; // ==================== Add Link Names ===================== @@ -103,14 +277,24 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,) { .append("text") .attr("class", "link-text") .text( function (d) { - //console.log(d); return d.predicate; }) - .style("fill",function(d){return "#28B463";}) + .style("fill",function(d){var labelStr = d.predicate; + if(labelStr.includes('subClassOf')) + {return "#3498DB";} + if(labelStr.includes('subPropertyOf')) + {return "#85929E";} + return "#28B463";}) .style("font-size", "80%") .style("font-style", "italic") .attr('x', 12) .attr('y', 3) - ; + ; + + linkTexts.append("title") + .text(function(d) { var returnValue = 'Source : '+d.source +'\nProperty : '+d.predicate+'\nObject : '+d.target; + return returnValue; + }); + ; // ==================== Add Link Names ===================== var node = g.append("g") @@ -121,8 +305,14 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,) { ; var circles = node.append("circle") .attr("id",function(d){return d.nodeId ;}) - .attr("r","8") - .style("fill",function(d){ return "#311B92";}) + .attr("r",function(d){var labelStr = d.id; + if(labelStr.toLowerCase().includes('string')|| labelStr.toLowerCase().includes('integer')|| labelStr.toLowerCase().includes('datetime')|| labelStr.toLowerCase().includes('boolean')) + {return 6;} + return 10;}) + .style("fill",function(d){var labelStr = d.id; + if(labelStr.toLowerCase().includes('string')|| labelStr.toLowerCase().includes('integer')|| labelStr.toLowerCase().includes('datetime')|| labelStr.toLowerCase().includes('boolean')) + {return "#FF9800";} + return "#311B92";}) .call(d3.drag() .on("start", dragstarted) .on("drag", dragged) @@ -131,13 +321,36 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,) { var lables = node.append("text") .attr("class", "node-text") - .text(function (d) { return d.id; }) - .style("font-size","100%") - .style("fill","#311B92") + .text(function (d) { + var labelStr = d.id; + if(labelStr.toLowerCase().includes('string')){return "String";} + if(labelStr.toLowerCase().includes('datetime')){return "DateTime";} + if(labelStr.toLowerCase().includes('integer')){return "Integer";} + if(labelStr.toLowerCase().includes('boolean')){return "Boolean";} + return d.id; + }) + .style("font-size", function(d){var labelStr = d.id; + if(labelStr.toLowerCase().includes('string')|| labelStr.toLowerCase().includes('integer')|| labelStr.toLowerCase().includes('datetime')|| labelStr.toLowerCase().includes('boolean')) + {return "80%";} + return "100%";}) + .style("font-style", function(d){var labelStr = d.id; + if(labelStr.toLowerCase().includes('string')|| labelStr.toLowerCase().includes('integer')|| labelStr.toLowerCase().includes('datetime')|| labelStr.toLowerCase().includes('boolean')) + {return "italic";} + return "bold";}) + .style("fill",function(d){var labelStr = d.id; + if(labelStr.toLowerCase().includes('string')|| labelStr.toLowerCase().includes('integer')|| labelStr.toLowerCase().includes('datetime')|| labelStr.toLowerCase().includes('boolean')) + {return "#FF9800";} + return "#311B92";}) .attr('x', 12) .attr('y', 3) ; + node.append("title") + .text(function(d) { + var returnValue = 'Node : '+d.id; + return returnValue; }) + ; + simulation .nodes(nodesArray) .on("tick", ticked) @@ -160,7 +373,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,) { .attr("y2", function(d) { return d.target.y; }) ; linkTexts - .attr("x", function(d) { //return Math.max(5, Math.min(width - 10, (d.source.x + d.target.x)/2 )); + .attr("x", function(d) { return 4 + (d.source.x + d.target.x)/2 ; }) .attr("y", function(d) { return 4 + (d.source.y + d.target.y)/2 ; }) @@ -171,6 +384,31 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,) { }) ; } + function getLabel(displayDeustch,id) + { + var returnVaule = "noLabel" + if(!displayDeustch) + { + enLabelArray.forEach(function(elem) + { + if(elem["id"] === id) + { + returnVaule = elem["value"]; + } + }); + } + else if(displayDeustch) + { + deLabelArray.forEach(function(elem) + { + if(elem["id"] === id) + { + returnVaule = elem["value"]; + } + }); + } + return returnVaule; + } function createNewNode(tempSub,tempPred,tempObj) { From 1b8ff64a68ed0036af637b1b0564f0ee7238cd39 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Tue, 25 Jun 2019 16:06:34 +0200 Subject: [PATCH 08/66] docker thing --- ida-chatbot/src/app/app.module.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index 2319bd029..8256ba15e 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -61,7 +61,7 @@ import { SsbViewComponent } from './components/ssb-view/ssb-view.component'; import { VennViewComponent } from './components/venn-view/venn-view.component'; import { DeckglHexViewComponent } from './components/deckgl-hex-view/deckgl-hex-view.component'; import { RdfOntologyViewComponent } from './components/rdf-ontology-view/rdf-ontology-view.component'; -//import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ declarations: [ @@ -123,8 +123,8 @@ import { RdfOntologyViewComponent } from './components/rdf-ontology-view/rdf-ont MatTabsModule, MatToolbarModule, MatTooltipModule, - FlexLayoutModule//, - // NgbModule + FlexLayoutModule, + NgbModule ], providers: [{ provide: HTTP_INTERCEPTORS, From 6b074230b4ff8793672ea4ab1edea668e7f1520f Mon Sep 17 00:00:00 2001 From: himadri-kumari Date: Tue, 25 Jun 2019 16:26:13 +0200 Subject: [PATCH 09/66] implemented graph bounded and Zoom functionality. implemented diable Zoom functionality and included it into filter tab. --- .../rdf-ontology-view.component.html | 12 ++++++++--- .../rdf-ontology-view.component.ts | 9 +++++--- .../d3v4-rdf-ontology-graph-view.js | 21 ++++++++++++++++++- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index b716ff230..9cec49219 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -1,7 +1,5 @@
- + +

RDF Ontology Class Hierarchy

-
RDF-ontology-class-hierarchy img
+
diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts index a2c73c6c3..b50fe0ca1 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit,AfterViewInit,} from '@angular/core'; import {UniqueIdProviderService} from '../../service/misc/unique-id-provider.service'; -declare function createV4RDFOntologyGraph(a, b,c,d,e,f); +declare function createV4RDFOntologyGraph(a, b,c,d,e,f,g,h); @Component({ selector: 'app-rdf-ontology-view', templateUrl: './rdf-ontology-view.component.html', @@ -15,6 +15,8 @@ export class RdfOntologyViewComponent implements OnInit { languageCheked = false; classHeirarchyChecked = true; allPropChecked = false; + allNodesInBoundClicked = false; + disableZoomClicked = false; constructor(public uip: UniqueIdProviderService) { this.figId = 'fig' + this.uip.getUniqueId(); @@ -25,10 +27,11 @@ export class RdfOntologyViewComponent implements OnInit { } ngAfterViewInit() { this.fileName = ""; - createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked,this.allPropChecked); + createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked,this.allPropChecked,this.allNodesInBoundClicked,this.disableZoomClicked); } checkboxValuesChanged(event: any){ - createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked,this.allPropChecked); + createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked,this.allPropChecked,this.allNodesInBoundClicked,this.disableZoomClicked); + } } diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index adb4fa19e..039b24467 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -1,4 +1,4 @@ -function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displaySubclasses,dispalyAllprop,) { +function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displaySubclasses,dispalyAllprop,applyNodesBoundary,disableZoom) { var linksArray = []; var nodesArray = []; var enLabelArray = []; @@ -383,7 +383,26 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS return "translate(" + d.x + "," + d.y + ")"; }) ; + if(applyNodesBoundary) + { + node + .attr("cx", function(d) { return d.x = Math.max(Math.max(resourceRadius,literalRadius), Math.min(width - Math.max(resourceRadius,literalRadius), d.x)); }) + .attr("cy", function(d) { return d.y = Math.max(Math.max(resourceRadius,literalRadius), Math.min(height - Math.max(resourceRadius,literalRadius), d.y)); }); + } + } + + if(!disableZoom) + { + var zoom_handler = d3.zoom() + .on("zoom", zoom_actions); + zoom_handler(svg); + //Zoom functions + function zoom_actions(){ + g.attr("transform", d3.event.transform) + + } } + function getLabel(displayDeustch,id) { var returnVaule = "noLabel" From 296b39f8090c66316d8c588353c2fe5a0011c5e3 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Tue, 25 Jun 2019 16:38:12 +0200 Subject: [PATCH 10/66] 1. implement reset graph functionality and include it into filter tab. 2. implement right side card into rdf ontology graph component. --- .../rdf-ontology-view.component.html | 19 +++++++++++++++---- .../rdf-ontology-view.component.ts | 12 ++++++++++++ .../d3v4-rdf-ontology-graph-view.js | 4 ++-- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index 9cec49219..c850b7db5 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -1,4 +1,10 @@ -
+ +
+

RDF Ontology Graph

+
+
+
-
-

RDF Ontology Class Hierarchy

-
+
+
diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts index b50fe0ca1..eb4a08cde 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts @@ -34,4 +34,16 @@ export class RdfOntologyViewComponent implements OnInit { createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked,this.allPropChecked,this.allNodesInBoundClicked,this.disableZoomClicked); } + graphResetChanged(event){ + this.languageCheked = false; + this.classHeirarchyChecked = true; + this.allPropChecked = false; + //this.graphResetClicked = false; + this.allNodesInBoundClicked = false; + this.disableZoomClicked = false; + + console.log('inside reset'); + createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked,this.allPropChecked,this.allNodesInBoundClicked,this.disableZoomClicked); + //this.graphResetClicked = false; + } } diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index 039b24467..7d4ec0cdc 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -386,8 +386,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS if(applyNodesBoundary) { node - .attr("cx", function(d) { return d.x = Math.max(Math.max(resourceRadius,literalRadius), Math.min(width - Math.max(resourceRadius,literalRadius), d.x)); }) - .attr("cy", function(d) { return d.y = Math.max(Math.max(resourceRadius,literalRadius), Math.min(height - Math.max(resourceRadius,literalRadius), d.y)); }); + .attr("cx", function(d) { return d.x = Math.max(Math.max(10,6), Math.min(width - Math.max(10,6), d.x)); }) + .attr("cy", function(d) { return d.y = Math.max(Math.max(10,6), Math.min(height - Math.max(10,6), d.y)); }); } } From d755083e1be2c9fffb37c4e8b1f1375f5a993b3a Mon Sep 17 00:00:00 2001 From: himadri-kumari Date: Tue, 25 Jun 2019 16:45:53 +0200 Subject: [PATCH 11/66] implement the node information section structure in right side card. --- .../rdf-ontology-view.component.html | 37 +++++++++++++++++-- .../d3v4-rdf-ontology-graph-view.js | 2 +- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index c850b7db5..7a1bb5243 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -1,4 +1,3 @@ -
@@ -37,7 +36,39 @@

RDF Ontology Graph

+
+
+ +
+ +
+
+ +
+ +

+ +

+ +

+ +

+
-
- +
+
diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index 7d4ec0cdc..8c4ed24ca 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -4,7 +4,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS var enLabelArray = []; var deLabelArray = []; - var width = 1000,height = 900; + var width = 1060,height = 900; var svgClear = d3.select("#"+svgId); svgClear.selectAll("*").remove(); From 3480643c1a4801e439d6f3f7d045bc4e5e2a7b42 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Tue, 25 Jun 2019 16:51:55 +0200 Subject: [PATCH 12/66] 1. implement the customization graph section structure in right side card. --- ida-chatbot/src/app/app.module.ts | 6 +- .../rdf-ontology-view.component.css | 11 ++++ .../rdf-ontology-view.component.html | 56 +++++++++++++++++++ .../rdf-ontology-view.component.ts | 17 +++++- 4 files changed, 84 insertions(+), 6 deletions(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index 8256ba15e..6ac16bf1b 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -61,7 +61,7 @@ import { SsbViewComponent } from './components/ssb-view/ssb-view.component'; import { VennViewComponent } from './components/venn-view/venn-view.component'; import { DeckglHexViewComponent } from './components/deckgl-hex-view/deckgl-hex-view.component'; import { RdfOntologyViewComponent } from './components/rdf-ontology-view/rdf-ontology-view.component'; -import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +//import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ declarations: [ @@ -123,8 +123,8 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; MatTabsModule, MatToolbarModule, MatTooltipModule, - FlexLayoutModule, - NgbModule + FlexLayoutModule//, + //NgbModule ], providers: [{ provide: HTTP_INTERCEPTORS, diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css index 51892118d..97fa6237f 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css @@ -14,4 +14,15 @@ position: relative; top: -8px; *overflow: hidden; + } + .inputLabelClass { + padding-left: 10px; + font-size: 19px; + float: left; + } + + .inputTextClass { + border-radius: 8px; + width: 33%; + padding-left: 3px; } \ No newline at end of file diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index 7a1bb5243..28bcdbdc8 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -69,6 +69,62 @@

RDF Ontology Graph



+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+


+ + +
diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts index eb4a08cde..649d62f40 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts @@ -17,6 +17,11 @@ export class RdfOntologyViewComponent implements OnInit { allPropChecked = false; allNodesInBoundClicked = false; disableZoomClicked = false; + edgeSize = 100; + graphCharge = 1000; + resourceRadius = 10; + literalRadius = 6; + resourceNodeColor ="#311B92"; constructor(public uip: UniqueIdProviderService) { this.figId = 'fig' + this.uip.getUniqueId(); @@ -38,12 +43,18 @@ export class RdfOntologyViewComponent implements OnInit { this.languageCheked = false; this.classHeirarchyChecked = true; this.allPropChecked = false; - //this.graphResetClicked = false; + this.allNodesInBoundClicked = false; + this.disableZoomClicked = false; + createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked,this.allPropChecked,this.allNodesInBoundClicked,this.disableZoomClicked); + } + + applyConfigClicked(event){ + this.languageCheked = false; + this.classHeirarchyChecked = true; + this.allPropChecked = false; this.allNodesInBoundClicked = false; this.disableZoomClicked = false; - console.log('inside reset'); createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked,this.allPropChecked,this.allNodesInBoundClicked,this.disableZoomClicked); - //this.graphResetClicked = false; } } From 2d863da8978eecf5b242994645cde7589db583df Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Tue, 25 Jun 2019 16:52:53 +0200 Subject: [PATCH 13/66] docker thing --- ida-chatbot/src/app/app.module.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index 6ac16bf1b..b4c9ea014 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -61,7 +61,7 @@ import { SsbViewComponent } from './components/ssb-view/ssb-view.component'; import { VennViewComponent } from './components/venn-view/venn-view.component'; import { DeckglHexViewComponent } from './components/deckgl-hex-view/deckgl-hex-view.component'; import { RdfOntologyViewComponent } from './components/rdf-ontology-view/rdf-ontology-view.component'; -//import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ declarations: [ @@ -123,8 +123,8 @@ import { RdfOntologyViewComponent } from './components/rdf-ontology-view/rdf-ont MatTabsModule, MatToolbarModule, MatTooltipModule, - FlexLayoutModule//, - //NgbModule + FlexLayoutModule, + NgbModule ], providers: [{ provide: HTTP_INTERCEPTORS, From 58fdd4146a8a8bfc485fa2578c977526ef7b261f Mon Sep 17 00:00:00 2001 From: himadri-kumari Date: Tue, 25 Jun 2019 17:09:30 +0200 Subject: [PATCH 14/66] - removed the edge label and replace the literal node label with edge label in literals nodes. - for subclass edges change the marker color to gray. - display the marker in correct position in graph. - started implementing the double click function to display the node ifnormation in right side card. --- .../rdf-ontology-view.component.html | 38 +++- .../rdf-ontology-view.component.ts | 65 +++++- .../d3v4-rdf-ontology-graph-view.js | 198 +++++++++++++----- 3 files changed, 235 insertions(+), 66 deletions(-) diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index 28bcdbdc8..bedc17ddc 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -10,7 +10,7 @@

RDF Ontology Graph

@@ -43,7 +43,7 @@

RDF Ontology Graph


@@ -88,7 +88,7 @@

RDF Ontology Graph


@@ -119,7 +119,7 @@

RDF Ontology Graph


@@ -128,37 +128,37 @@

RDF Ontology Graph

style="display: block;background-color:#AED6F1;border-radius: 8px;height: 480px; padding-top: 10px;">















- - + Comment: + +
+
+ + +
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+




+ + +
+ +
-
- + + \ No newline at end of file From 3ae262702153303d2109b0168ce2d6ba16b2f42e Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Tue, 2 Jul 2019 11:22:56 +0200 Subject: [PATCH 25/66] fixing graph display issues after tab implementation. --- .../rdf-ontology-view.component.html | 24 +++++++++---------- .../d3v4-rdf-ontology-graph-view.js | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index 6404448b5..a238df0a1 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -3,7 +3,7 @@
-

RDF Ontology Graph

+

Historian Ontology Graph

@@ -62,63 +62,63 @@

RDF Ontology Graph

Node:
-
+

-
+

-
+

-
+

-
+

-
+

-
+

-
+

-
+

@@ -127,7 +127,7 @@

RDF Ontology Graph

-
+

+
\ No newline at end of file diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index c83943b36..633465b7c 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -7,7 +7,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS var expandedNodesArray = []; var nodeContents = []; - var width = 1060,height = 900,resourceRadius = customizeGraphArray.resourceRadius,literalRadius = customizeGraphArray.literalRadius; + var width = 1025,height = 1100,resourceRadius = customizeGraphArray.resourceRadius,literalRadius = customizeGraphArray.literalRadius; var g,link,linkTexts,node,circles,lables; var svgClear = d3.select("#"+svgId); From 5cc167c8325470fcc06aac7adaa7932081c82610 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Tue, 2 Jul 2019 11:39:46 +0200 Subject: [PATCH 26/66] ready for code review --- ida-chatbot/src/app/app.module.ts | 2 +- .../rdf-ontology-view.component.ts | 9 ----- .../d3v4-rdf-ontology-graph-view.js | 38 +++++-------------- 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index 18c6ada06..b4c9ea014 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -124,7 +124,7 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; MatToolbarModule, MatTooltipModule, FlexLayoutModule, - NgbModule + NgbModule ], providers: [{ provide: HTTP_INTERCEPTORS, diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts index 16103d3fd..021fefee9 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts @@ -101,15 +101,6 @@ export class RdfOntologyViewComponent implements OnInit { } createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked, this.allPropChecked,this.allNodesInBoundClicked,this.disableZoomClicked,idVal,customizeGraphVals); - - /*if(event === "yes") - { - createV4RDFOntologyGraph(this.figId1, this.svgId1,this.fileName,"de",true,true); - } - else if(event === "no") - { - createV4RDFOntologyGraph(this.figId1, this.svgId1,this.fileName,"en",true,false); - }*/ } graphResetChanged(event){ this.languageCheked = false; diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index 633465b7c..d0eab0a82 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -171,7 +171,6 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; linksArray.push(tripleValue); - //createNewNode(tempSub,'---subClassOf---',tempObj); createNewNode(tempSub,pred,tempObj,false,''); }); } @@ -184,11 +183,9 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempObj = tempLabelArray1[tempLabelArray1.length -1 ]; } - //var tripleValue = {source:tempSub, predicate:'---subClassOf---', target:tempObj,value: 1}; var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; linksArray.push(tripleValue); - //createNewNode(tempSub,'---subClassOf---',tempObj); createNewNode(tempSub,pred,tempObj,false,''); } } @@ -201,8 +198,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS //get the subject label if(element["rdfs:domain"]!=undefined) { - if(Object.prototype.toString.call(element["rdfs:domain"]) === '[object Array]'){ - //console.log("inside if"); + if(Object.prototype.toString.call(element["rdfs:domain"]) === '[object Array]') + { element["rdfs:domain"].forEach(function(eachIds) { var tempDomainLabel = getLabel(displayDeustch,eachIds["@id"]); @@ -241,8 +238,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS //get the object range - if(element["rdfs:range"]!=undefined){ - //console.log(element.domain["@id"]); + if(element["rdfs:range"]!=undefined) + { if ("@id" in element["rdfs:range"]) { tempObj = getLabel(displayDeustch,element["rdfs:range"]["@id"]); @@ -263,7 +260,6 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempObj = tempObj + literalIndex; literalIndex = literalIndex + 1 ; isLitteral = true; - console.log('tempObj 0 '+tempObj); } if(!tempDomainArray.length ==0) @@ -330,18 +326,15 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS .attr("y2", function(d) { return d.target.y; }) ; linkTexts - .attr("x", function(d) { //return Math.max(5, Math.min(width - 10, (d.source.x + d.target.x)/2 )); + .attr("x", function(d) { return 4 + (d.source.x + d.target.x)/2 ; }) .attr("y", function(d) { - // return Math.max(5, Math.min(height - 10, (d.source.y + d.target.y)/2)); return 4 + (d.source.y + d.target.y)/2 ; }) ; node .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; - //return "translate(" + Math.max(10, Math.min(width - 10, d.x)) + "," + Math.max(5, Math.min(height - 10, d.y)) + ")"; - //return "translate(" + (d.x < 1000 ? d.x = 100 : d.x > 1000 ? d.x = 900 : d.x) + "," + (d.y < 1000 ? d.y = 100 : d.y > 900 ? d.y = 900 : d.y) + ")"; - }) + }) ; if(applyNodesBoundary) { @@ -415,14 +408,12 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS nodesArray.push(nodeValue); } //END :: Node creation - //console.log("nodeValue len =>"+nodesArray.length); } function clickFunctionality(d) { var idVal = "#"+d.nodeId; var clickedNodeLabel = d.id; - console.log("d.id =< "+d.id); if(expandedNodesArray.length === 0 || !expandedNodesArray.includes(idVal)) { expandedNodesArray.push(idVal); @@ -449,7 +440,6 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { if(Object.prototype.toString.call(element["rdfs:domain"]) === '[object Array]') { - //console.log("inside if"); element["rdfs:domain"].forEach(function(eachIds) { var tempDomainLabel = getLabel(displayDeustch,eachIds["@id"]); @@ -464,7 +454,6 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { includeThis = true; tempDomainArray.push(tempDomainLabel); - console.log("include tempDomainLabel< "+tempDomainLabel); } }); @@ -482,7 +471,6 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS if(clickedNodeLabel === tempSub) { includeThis = true; - console.log("include tempSub< "+element["@id"]); } } } @@ -501,11 +489,9 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS } } - //get the object range if(element["rdfs:range"]!=undefined) { - //console.log(element.domain["@id"]); if ("@id" in element["rdfs:range"]) { tempObj = getLabel(displayDeustch,element["rdfs:range"]["@id"]); @@ -538,15 +524,13 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { var tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; linksArray.push(tripleValue); - console.log("include 1 source "+el +" predicate- "+tempPred +" target-" +tempObj); - createNewNode(el,tempPred,tempObj,isLitteral,literalDataType,element,this.simulation); + createNewNode(el,tempPred,tempObj,isLitteral,literalDataType,element); } else { var tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; linksArray.push(tripleValue); - console.log("include 2 source "+el +" predicate- "+tempPred +" target-" +tempObj); - createNewNode(el,tempPred,tempObj,isLitteral,literalDataType,this.simulation); + createNewNode(el,tempPred,tempObj,isLitteral,literalDataType); } } }); @@ -559,15 +543,13 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { var tripleValue = {source:tempSub, predicate:' ', target:tempPred,value: 1}; linksArray.push(tripleValue); - console.log("include 3 source "+tempSub +" predicate- "+tempPred +" target-" +tempObj); - createNewNode(tempSub,'',tempPred,isLitteral,literalDataType,this.simulation); + createNewNode(tempSub,'',tempPred,isLitteral,literalDataType); } else { var tripleValue = {source:tempSub, predicate:tempPred, target:tempObj,value: 1}; linksArray.push(tripleValue); - console.log("include 4 source "+tempSub +" predicate- "+tempPred +" target-" +tempObj); - createNewNode(tempSub,tempPred,tempObj,isLitteral,literalDataType,this.simulation); + createNewNode(tempSub,tempPred,tempObj,isLitteral,literalDataType); } } } From 3b3ed4778a55d45f4729212018444ee58f4d3ca6 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Tue, 2 Jul 2019 12:02:41 +0200 Subject: [PATCH 27/66] fix the Codacy/PR Quality Review issues --- .../d3v4-rdf-ontology-graph-view.js | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index d0eab0a82..80400a52a 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -62,13 +62,13 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { if(elem["rdfs:label"] !== undefined) { - if(Object.prototype.toString.call(elem["rdfs:label"]) === '[object Array]') + if(Object.prototype.toString.call(elem["rdfs:label"]) === "[object Array]") { elem["rdfs:label"].forEach(function(eachIds) { if(eachIds["@language"] === "de") { - var tempLabel = {"id":elem["@id"],"language":"de","value":eachIds["@value"]} + var tempLabel = {"id":elem["@id"],"language":"de","value":eachIds["@value"]}; deLabelArray.push(tempLabel); var tepmNodeContent = {label:eachIds["@value"], contents:elem}; @@ -76,8 +76,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS } if(eachIds["@language"] === "en") { - var tempLabel = {"id":elem["@id"],"language":"en","value":eachIds["@value"]} - enLabelArray.push(tempLabel); + var tempLabel1 = {"id":elem["@id"],"language":"en","value":eachIds["@value"]}; + enLabelArray.push(tempLabel1); var tepmNodeContent = {label:eachIds["@value"], contents:elem}; nodeContents.push(tepmNodeContent); @@ -85,9 +85,9 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS var tempLabelArray = elem["@id"].split('/'); var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - var tempLabel = tempLabelArray1[tempLabelArray1.length -1 ]; + var tempLabel2 = tempLabelArray1[tempLabelArray1.length -1 ]; - var tepmNodeContent = {label:tempLabel, contents:elem}; + var tepmNodeContent = {label:tempLabel2, contents:elem}; nodeContents.push(tepmNodeContent); @@ -95,28 +95,28 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS } else { - if(elem["rdfs:label"]["@language"] == "de") + if(elem["rdfs:label"]["@language"] === "de") { - var tempLabel = {"id":elem["@id"],"language":"de","value":elem["rdfs:label"]["@value"]} - deLabelArray.push(tempLabel); + var tempLabel3 = {"id":elem["@id"],"language":"de","value":elem["rdfs:label"]["@value"]}; + deLabelArray.push(tempLabel3); var tepmNodeContent = {label:elem["rdfs:label"]["@value"], contents:elem}; nodeContents.push(tepmNodeContent); } if(elem["rdfs:label"]["@language"] === "en") { - var tempLabel = {"id":elem["@id"],"language":"en","value":elem["rdfs:label"]["@value"]}; - enLabelArray.push(tempLabel); + var tempLabel4 = {"id":elem["@id"],"language":"en","value":elem["rdfs:label"]["@value"]}; + enLabelArray.push(tempLabel4); var tepmNodeContent = {label:elem["rdfs:label"]["@value"], contents:elem}; nodeContents.push(tepmNodeContent); } - var tempLabelArray = elem["@id"].split('/'); + var tempLabelArray = elem["@id"].split("/"); var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(":"); - var tempLabel = tempLabelArray1[tempLabelArray1.length -1 ]; + var tempLabel5 = tempLabelArray1[tempLabelArray1.length -1 ]; - var tepmNodeContent = {label:tempLabel, contents:elem}; + var tepmNodeContent = {label:tempLabel5, contents:elem}; nodeContents.push(tepmNodeContent); } } @@ -124,9 +124,9 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { var tempLabelArray = elem["@id"].split("/"); var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - var tempLabel = tempLabelArray1[tempLabelArray1.length -1 ]; + var tempLabel6 = tempLabelArray1[tempLabelArray1.length -1 ]; - var tepmNodeContent = {label:tempLabel, contents:elem}; + var tepmNodeContent = {label:tempLabel6, contents:elem}; nodeContents.push(tepmNodeContent); } @@ -186,7 +186,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; linksArray.push(tripleValue); - createNewNode(tempSub,pred,tempObj,false,''); + createNewNode(tempSub,pred,tempObj,false," "); } } } @@ -217,7 +217,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempSub = getLabel(displayDeustch,element["rdfs:domain"]["@id"]); if(tempSub == "noLabel") { - var tempLabelArray = element["rdfs:domain"]["@id"].split('/'); + var tempLabelArray = element["rdfs:domain"]["@id"].split("/"); var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempSub = tempLabelArray1[tempLabelArray1.length -1 ]; } @@ -262,7 +262,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS isLitteral = true; } - if(!tempDomainArray.length ==0) + if(tempDomainArray.length !==0) { tempDomainArray.forEach(function(el) { From 15650d8fcae995aa7085a8009049fee0e0c7c205 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Wed, 3 Jul 2019 19:58:05 +0200 Subject: [PATCH 28/66] try resolving merge conflict --- ida-chatbot/src/app/app.module.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index b4c9ea014..0d0673135 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -59,8 +59,8 @@ import {RestService} from './service/rest/rest.service'; import {DatatableDetailComponent} from './components/datatable-detail/datatable-detail.component'; import { SsbViewComponent } from './components/ssb-view/ssb-view.component'; import { VennViewComponent } from './components/venn-view/venn-view.component'; -import { DeckglHexViewComponent } from './components/deckgl-hex-view/deckgl-hex-view.component'; import { RdfOntologyViewComponent } from './components/rdf-ontology-view/rdf-ontology-view.component'; +import { DeckglHexViewComponent } from './components/deckgl-hex-view/deckgl-hex-view.component'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ @@ -81,8 +81,9 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; DatatableDetailComponent, SsbViewComponent, VennViewComponent, - DeckglHexViewComponent, - RdfOntologyViewComponent + RdfOntologyViewComponent, + DeckglHexViewComponent + ], imports: [ BrowserModule, From 73c6dbbeb3db93a60ab8917b565f775c7f0882f6 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Wed, 3 Jul 2019 20:02:11 +0200 Subject: [PATCH 29/66] try resolving merge conflict .. --- ida-chatbot/src/app/app.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index 0d0673135..9952ac3ba 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -74,6 +74,7 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; DataViewContainerComponent, DatatableViewComponent, FdgViewComponent, + RdfOntologyViewComponent, BargraphViewComponent, IntroComponent, ClickStopPropagationDirective, @@ -81,7 +82,6 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; DatatableDetailComponent, SsbViewComponent, VennViewComponent, - RdfOntologyViewComponent, DeckglHexViewComponent ], From 465abf53859119e0bdc24e8f24895fedb38c0f8c Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Wed, 3 Jul 2019 22:17:02 +0200 Subject: [PATCH 30/66] Update app.module.ts try resolving merge conflict... --- ida-chatbot/src/app/app.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index 9952ac3ba..f404865a2 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -83,7 +83,7 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; SsbViewComponent, VennViewComponent, DeckglHexViewComponent - + ], imports: [ BrowserModule, From 764359fb21497b46a06b4169c6dd92da7e37a76c Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Wed, 3 Jul 2019 22:19:09 +0200 Subject: [PATCH 31/66] try resolving merge conflict --- ida-chatbot/src/app/app.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index f404865a2..702215c89 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -82,7 +82,7 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; DatatableDetailComponent, SsbViewComponent, VennViewComponent, - DeckglHexViewComponent + DeckglHexViewComponent, ], imports: [ From 2b92da219500c777d1dbf2ca25d4bd13476c8275 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Wed, 3 Jul 2019 22:20:52 +0200 Subject: [PATCH 32/66] try resolving merge conflict --- ida-chatbot/src/app/app.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index 702215c89..cc2289540 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -83,7 +83,6 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; SsbViewComponent, VennViewComponent, DeckglHexViewComponent, - ], imports: [ BrowserModule, From 04bdeefc02deba6e9231928909844acc827f5d7f Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Thu, 4 Jul 2019 15:49:31 +0200 Subject: [PATCH 33/66] try resolving merge conflict .. --- ida-chatbot/src/app/app.module.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index cc2289540..cc5f51586 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -83,6 +83,7 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; SsbViewComponent, VennViewComponent, DeckglHexViewComponent, + ], imports: [ BrowserModule, From 9666b566c77c22a64652ebcdafe8c1c203e0bd43 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Thu, 4 Jul 2019 16:24:08 +0200 Subject: [PATCH 34/66] resolve Codacy/PR Quality Review issues --- .../d3v4-rdf-ontology-graph-view.js | 160 ++++++++++-------- 1 file changed, 87 insertions(+), 73 deletions(-) diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index 80400a52a..0f06144a4 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -55,6 +55,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS .force("charge", d3.forceManyBody().strength(-customizeGraphArray.graphCharge)) //Charge strength is here .force("center", d3.forceCenter((width / 2), (height / 2))); + var tempLabel,tepmNodeContent,tempLabelArray,tempLabelArray1; + d3.json("assets/rdfontology/historian-onlogoly.json", function(error, data) { //START :: get english and deutsch labels values into arrays @@ -68,26 +70,26 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { if(eachIds["@language"] === "de") { - var tempLabel = {"id":elem["@id"],"language":"de","value":eachIds["@value"]}; + tempLabel = {"id":elem["@id"],"language":"de","value":eachIds["@value"]}; deLabelArray.push(tempLabel); - var tepmNodeContent = {label:eachIds["@value"], contents:elem}; + tepmNodeContent = {label:eachIds["@value"], contents:elem}; nodeContents.push(tepmNodeContent); } if(eachIds["@language"] === "en") { - var tempLabel1 = {"id":elem["@id"],"language":"en","value":eachIds["@value"]}; - enLabelArray.push(tempLabel1); + tempLabel = {"id":elem["@id"],"language":"en","value":eachIds["@value"]}; + enLabelArray.push(tempLabel); - var tepmNodeContent = {label:eachIds["@value"], contents:elem}; + tepmNodeContent = {label:eachIds["@value"], contents:elem}; nodeContents.push(tepmNodeContent); } - var tempLabelArray = elem["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - var tempLabel2 = tempLabelArray1[tempLabelArray1.length -1 ]; + tempLabelArray = elem["@id"].split('/'); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabel = tempLabelArray1[tempLabelArray1.length -1 ]; - var tepmNodeContent = {label:tempLabel2, contents:elem}; + tepmNodeContent = {label:tempLabel, contents:elem}; nodeContents.push(tepmNodeContent); @@ -97,36 +99,36 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { if(elem["rdfs:label"]["@language"] === "de") { - var tempLabel3 = {"id":elem["@id"],"language":"de","value":elem["rdfs:label"]["@value"]}; - deLabelArray.push(tempLabel3); + tempLabel = {"id":elem["@id"],"language":"de","value":elem["rdfs:label"]["@value"]}; + deLabelArray.push(tempLabel); - var tepmNodeContent = {label:elem["rdfs:label"]["@value"], contents:elem}; + tepmNodeContent = {label:elem["rdfs:label"]["@value"], contents:elem}; nodeContents.push(tepmNodeContent); } if(elem["rdfs:label"]["@language"] === "en") { - var tempLabel4 = {"id":elem["@id"],"language":"en","value":elem["rdfs:label"]["@value"]}; - enLabelArray.push(tempLabel4); + tempLabel = {"id":elem["@id"],"language":"en","value":elem["rdfs:label"]["@value"]}; + enLabelArray.push(tempLabel); - var tepmNodeContent = {label:elem["rdfs:label"]["@value"], contents:elem}; + tepmNodeContent = {label:elem["rdfs:label"]["@value"], contents:elem}; nodeContents.push(tepmNodeContent); } - var tempLabelArray = elem["@id"].split("/"); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(":"); - var tempLabel5 = tempLabelArray1[tempLabelArray1.length -1 ]; + tempLabelArray = elem["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(":"); + tempLabel = tempLabelArray1[tempLabelArray1.length -1 ]; - var tepmNodeContent = {label:tempLabel5, contents:elem}; + tepmNodeContent = {label:tempLabel, contents:elem}; nodeContents.push(tepmNodeContent); } } else { - var tempLabelArray = elem["@id"].split("/"); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - var tempLabel6 = tempLabelArray1[tempLabelArray1.length -1 ]; + tempLabelArray = elem["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabel = tempLabelArray1[tempLabelArray1.length -1 ]; - var tepmNodeContent = {label:tempLabel6, contents:elem}; + tepmNodeContent = {label:tempLabel, contents:elem}; nodeContents.push(tepmNodeContent); } @@ -136,13 +138,20 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS //START :: Creation of Graph depenging on displaySubclasses and dispalyAllprop values var literalIndex = 0; var circleIdIndex = 0; + var tempSub ="?"; + var tempPred ="?"; + var tempObj ="?"; + var pred="---subClassOf---"; + var tempDomainArray = []; + var tripleValue,isLitteral,literalDataType; + data["@graph"].forEach(function(element) { - var tempSub ="?"; - var tempPred ="?"; - var tempObj ="?"; - var pred="---subClassOf---"; - var tempDomainArray = []; + tempSub ="?"; + tempPred ="?"; + tempObj ="?"; + pred="---subClassOf---"; + tempDomainArray = []; //START :: Nodes and Links creation for subClassOf if(displaySubclasses) { @@ -151,8 +160,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempSub = getLabel(displayDeustch,element["@id"]); if(tempSub == "noLabel") { - var tempLabelArray = element["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = element["@id"].split('/'); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempSub = tempLabelArray1[tempLabelArray1.length -1 ]; } @@ -163,12 +172,12 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempObj = getLabel(displayDeustch,eachIds["@id"]); if(tempObj == "noLabel") { - var tempLabelArray = eachIds["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = eachIds["@id"].split('/'); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempObj = tempLabelArray1[tempLabelArray1.length -1 ]; } - var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; + tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; linksArray.push(tripleValue); createNewNode(tempSub,pred,tempObj,false,''); @@ -179,11 +188,11 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempObj = getLabel(displayDeustch,element["rdfs:subClassOf"]["@id"]); if(tempObj == "noLabel") { - var tempLabelArray = element["rdfs:subClassOf"]["@id"].split("/"); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = element["rdfs:subClassOf"]["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempObj = tempLabelArray1[tempLabelArray1.length -1 ]; } - var tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; + tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; linksArray.push(tripleValue); createNewNode(tempSub,pred,tempObj,false," "); @@ -202,11 +211,11 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { element["rdfs:domain"].forEach(function(eachIds) { - var tempDomainLabel = getLabel(displayDeustch,eachIds["@id"]); + tempDomainLabel = getLabel(displayDeustch,eachIds["@id"]); if(tempDomainLabel == "noLabel") { - var tempLabelArray = eachIds["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = eachIds["@id"].split('/'); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempDomainLabel = tempLabelArray1[tempLabelArray1.length -1 ]; } tempDomainArray.push(tempDomainLabel); @@ -217,8 +226,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempSub = getLabel(displayDeustch,element["rdfs:domain"]["@id"]); if(tempSub == "noLabel") { - var tempLabelArray = element["rdfs:domain"]["@id"].split("/"); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = element["rdfs:domain"]["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempSub = tempLabelArray1[tempLabelArray1.length -1 ]; } } @@ -230,8 +239,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempPred = getLabel(displayDeustch,element["@id"]); if(tempPred == "noLabel") { - var tempLabelArray = element["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = element["@id"].split('/'); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempPred = tempLabelArray1[tempLabelArray1.length -1 ]; } } @@ -245,15 +254,15 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempObj = getLabel(displayDeustch,element["rdfs:range"]["@id"]); if(tempObj == "noLabel") { - var tempLabelArray = element["rdfs:range"]["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = element["rdfs:range"]["@id"].split('/'); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempObj = tempLabelArray1[tempLabelArray1.length -1 ]; } } } - var isLitteral = false; - var literalDataType = tempObj; + isLitteral = false; + literalDataType = tempObj; if(tempObj.toLowerCase().includes("string") || tempObj.toLowerCase().includes("boolean")|| tempObj.toLowerCase().includes("integer") || tempObj.toLowerCase().includes("datetime")) { @@ -270,13 +279,13 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { if(isLitteral) { - var tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; + tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; linksArray.push(tripleValue); createNewNode(el,tempPred,tempObj,isLitteral,literalDataType,element); } else { - var tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; + tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; linksArray.push(tripleValue); createNewNode(el,tempPred,tempObj,isLitteral,literalDataType); } @@ -289,13 +298,13 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { if(isLitteral) { - var tripleValue = {source:tempSub, predicate:' ', target:tempPred,value: 1}; + tripleValue = {source:tempSub, predicate:' ', target:tempPred,value: 1}; linksArray.push(tripleValue); createNewNode(tempSub,'',tempPred,isLitteral,literalDataType); } else { - var tripleValue = {source:tempSub, predicate:tempPred, target:tempObj,value: 1}; + tripleValue = {source:tempSub, predicate:tempPred, target:tempObj,value: 1}; linksArray.push(tripleValue); createNewNode(tempSub,tempPred,tempObj,isLitteral,literalDataType); } @@ -423,17 +432,22 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS .attr('r',resourceRadius+4) .style("fill",customizeGraphArray.onClickNodeColor) - + var tempSub ="?"; + var tempPred ="?"; + var tempObj ="?"; + var pred="---subClassOf---"; + var tempDomainArray = []; + var includeThis,tempDomainLabel,tempLabelArray,tempLabelArray1,isLitteral,literalDataType,tripleValue; data["@graph"].forEach(function(element) { - var tempSub ="?"; - var tempPred ="?"; - var tempObj ="?"; - var pred="---subClassOf---"; - var tempDomainArray = []; + tempSub ="?"; + tempPred ="?"; + tempObj ="?"; + pred="---subClassOf---"; + tempDomainArray = []; - var includeThis = false; + includeThis = false; //START :: Nodes and Links creation for all Properties //get the subject label if(element["rdfs:domain"]!=undefined) @@ -442,11 +456,11 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { element["rdfs:domain"].forEach(function(eachIds) { - var tempDomainLabel = getLabel(displayDeustch,eachIds["@id"]); + tempDomainLabel = getLabel(displayDeustch,eachIds["@id"]); if(tempDomainLabel == "noLabel") { - var tempLabelArray = eachIds["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = eachIds["@id"].split('/'); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempDomainLabel = tempLabelArray1[tempLabelArray1.length -1 ]; } @@ -463,8 +477,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempSub = getLabel(displayDeustch,element["rdfs:domain"]["@id"]); if(tempSub == "noLabel") { - var tempLabelArray = element["rdfs:domain"]["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = element["rdfs:domain"]["@id"].split('/'); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempSub = tempLabelArray1[tempLabelArray1.length -1 ]; } @@ -483,8 +497,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempPred = getLabel(displayDeustch,element["@id"]); if(tempPred == "noLabel") { - var tempLabelArray = element["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = element["@id"].split('/'); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempPred = tempLabelArray1[tempLabelArray1.length -1 ]; } } @@ -497,15 +511,15 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS tempObj = getLabel(displayDeustch,element["rdfs:range"]["@id"]); if(tempObj === "noLabel") { - var tempLabelArray = element["rdfs:range"]["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); + tempLabelArray = element["rdfs:range"]["@id"].split('/'); + tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); tempObj = tempLabelArray1[tempLabelArray1.length -1 ]; } } } - var isLitteral = false; - var literalDataType = tempObj; + isLitteral = false; + literalDataType = tempObj; if(tempObj.toLowerCase().includes("string") || tempObj.toLowerCase().includes("boolean")|| tempObj.toLowerCase().includes("integer") || tempObj.toLowerCase().includes("datetime")) { @@ -522,13 +536,13 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { if(isLitteral) { - var tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; + tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; linksArray.push(tripleValue); createNewNode(el,tempPred,tempObj,isLitteral,literalDataType,element); } else { - var tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; + tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; linksArray.push(tripleValue); createNewNode(el,tempPred,tempObj,isLitteral,literalDataType); } @@ -541,13 +555,13 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS { if(isLitteral) { - var tripleValue = {source:tempSub, predicate:' ', target:tempPred,value: 1}; + tripleValue = {source:tempSub, predicate:' ', target:tempPred,value: 1}; linksArray.push(tripleValue); createNewNode(tempSub,'',tempPred,isLitteral,literalDataType); } else { - var tripleValue = {source:tempSub, predicate:tempPred, target:tempObj,value: 1}; + tripleValue = {source:tempSub, predicate:tempPred, target:tempObj,value: 1}; linksArray.push(tripleValue); createNewNode(tempSub,tempPred,tempObj,isLitteral,literalDataType); } From fca10567cbf7196f4bbfc16583362cdfec62d4f9 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Thu, 4 Jul 2019 16:42:46 +0200 Subject: [PATCH 35/66] resolve Codacy/PR Quality Review issues --- ida-chatbot/src/app/app.module.ts | 6 +- .../d3v4-rdf-ontology-graph-view.js | 1936 +++++++++-------- 2 files changed, 974 insertions(+), 968 deletions(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index 6436d8b59..1f43aecfc 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -62,7 +62,7 @@ import { VennViewComponent } from './components/venn-view/venn-view.component'; import { RdfOntologyViewComponent } from './components/rdf-ontology-view/rdf-ontology-view.component'; import { DeckglHexViewComponent } from './components/deckgl-hex-view/deckgl-hex-view.component'; import { SpeechInputComponent } from './components/speech-input/speech-input.component'; -import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +//import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ declarations: [ AppComponent, @@ -124,8 +124,8 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; MatTabsModule, MatToolbarModule, MatTooltipModule, - FlexLayoutModule, - NgbModule + FlexLayoutModule//, + //NgbModule ], providers: [{ provide: HTTP_INTERCEPTORS, diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index 0f06144a4..90cb28248 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -1,5 +1,5 @@ -function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displaySubclasses, - dispalyAllprop,applyNodesBoundary,disableZoom,idsArray,customizeGraphArray) { +function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displaySubclasses, + dispalyAllprop, applyNodesBoundary, disableZoom, idsArray, customizeGraphArray) { var linksArray = []; var nodesArray = []; var enLabelArray = []; @@ -7,1047 +7,1053 @@ function createV4RDFOntologyGraph(figId, svgId, fileName,displayDeustch,displayS var expandedNodesArray = []; var nodeContents = []; - var width = 1025,height = 1100,resourceRadius = customizeGraphArray.resourceRadius,literalRadius = customizeGraphArray.literalRadius; + var width = 1025, + height = 1100, + resourceRadius = customizeGraphArray.resourceRadius, + literalRadius = customizeGraphArray.literalRadius; - var g,link,linkTexts,node,circles,lables; - var svgClear = d3.select("#"+svgId); - svgClear.selectAll("*").remove(); + var g, link, linkTexts, node, circles, lables; + var svgClear = d3.select("#" + svgId); + svgClear.selectAll("*").remove(); + + var svg = d3.select("#" + svgId) + .append("svg") + .attr("width", width) + .attr("height", height); - var svg = d3.select("#"+svgId) - .append("svg") - .attr("width", width) - .attr("height", height); - svg.append("svg:defs").selectAll("marker") - .data(["normal"]) - .enter().append("svg:marker") - .attr("id", String) - .attr("viewBox", "0 -4 10 10") - .attr("refX", 30) - .attr("refY", -0.5) - .attr("markerWidth", 26) - .attr("markerHeight", 6) - .attr("orient", "auto") - .append("svg:polyline") - .style("fill","black") - .attr("points", "0,-4 20,0 0,5") - ; + .data(["normal"]) + .enter().append("svg:marker") + .attr("id", String) + .attr("viewBox", "0 -4 10 10") + .attr("refX", 30) + .attr("refY", -0.5) + .attr("markerWidth", 26) + .attr("markerHeight", 6) + .attr("orient", "auto") + .append("svg:polyline") + .style("fill", "black") + .attr("points", "0,-4 20,0 0,5"); svg.append("svg:defs").selectAll("marker") - .data(["subclass"]) - .enter().append("svg:marker") - .attr("id", String) - .attr("viewBox", "0 -4 10 10") - .attr("refX", 30) - .attr("refY", -0.5) - .attr("markerWidth", 26) - .attr("markerHeight", 6) - .attr("orient", "auto") - .append("svg:polyline") - .style("fill", "grey") - .attr("points", "0,-4 20,0 0,5") - ; - + .data(["subclass"]) + .enter().append("svg:marker") + .attr("id", String) + .attr("viewBox", "0 -4 10 10") + .attr("refX", 30) + .attr("refY", -0.5) + .attr("markerWidth", 26) + .attr("markerHeight", 6) + .attr("orient", "auto") + .append("svg:polyline") + .style("fill", "grey") + .attr("points", "0,-4 20,0 0,5"); + var color = d3.scaleOrdinal(d3.schemeCategory20); var simulation = d3.forceSimulation() - .force("link", d3.forceLink().id(function(d) { return d.id; }).distance(customizeGraphArray.edgeSize)) - .force("charge", d3.forceManyBody().strength(-customizeGraphArray.graphCharge)) //Charge strength is here - .force("center", d3.forceCenter((width / 2), (height / 2))); - - var tempLabel,tepmNodeContent,tempLabelArray,tempLabelArray1; - - d3.json("assets/rdfontology/historian-onlogoly.json", function(error, data) - { - //START :: get english and deutsch labels values into arrays - data["@graph"].forEach(function(elem) - { - if(elem["rdfs:label"] !== undefined) - { - if(Object.prototype.toString.call(elem["rdfs:label"]) === "[object Array]") - { - elem["rdfs:label"].forEach(function(eachIds) - { - if(eachIds["@language"] === "de") - { - tempLabel = {"id":elem["@id"],"language":"de","value":eachIds["@value"]}; - deLabelArray.push(tempLabel); - - tepmNodeContent = {label:eachIds["@value"], contents:elem}; - nodeContents.push(tepmNodeContent); - } - if(eachIds["@language"] === "en") - { - tempLabel = {"id":elem["@id"],"language":"en","value":eachIds["@value"]}; - enLabelArray.push(tempLabel); + .force("link", d3.forceLink().id(function(d) { + return d.id; + }).distance(customizeGraphArray.edgeSize)) + .force("charge", d3.forceManyBody().strength(-customizeGraphArray.graphCharge)) //Charge strength is here + .force("center", d3.forceCenter((width / 2), (height / 2))); + + var tempLabel, tepmNodeContent, tempLabelArray, tempLabelArray1; + + d3.json("assets/rdfontology/historian-onlogoly.json", function(error, data) { + //START :: get english and deutsch labels values into arrays + data["@graph"].forEach(function(elem) { + if (elem["rdfs:label"] !== undefined) { + if (Object.prototype.toString.call(elem["rdfs:label"]) === "[object Array]") { + elem["rdfs:label"].forEach(function(eachIds) { + if (eachIds["@language"] === "de") { + tempLabel = { + "id": elem["@id"], + "language": "de", + "value": eachIds["@value"] + }; + deLabelArray.push(tempLabel); + + tepmNodeContent = { + label: eachIds["@value"], + contents: elem + }; + nodeContents.push(tepmNodeContent); + } + if (eachIds["@language"] === "en") { + tempLabel = { + "id": elem["@id"], + "language": "en", + "value": eachIds["@value"] + }; + enLabelArray.push(tempLabel); + + tepmNodeContent = { + label: eachIds["@value"], + contents: elem + }; + nodeContents.push(tepmNodeContent); + } + + tempLabelArray = elem["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempLabel = tempLabelArray1[tempLabelArray1.length - 1]; + + tepmNodeContent = { + label: tempLabel, + contents: elem + }; + nodeContents.push(tepmNodeContent); + + + }); + } else { + if (elem["rdfs:label"]["@language"] === "de") { + tempLabel = { + "id": elem["@id"], + "language": "de", + "value": elem["rdfs:label"]["@value"] + }; + deLabelArray.push(tempLabel); + + tepmNodeContent = { + label: elem["rdfs:label"]["@value"], + contents: elem + }; + nodeContents.push(tepmNodeContent); + } + if (elem["rdfs:label"]["@language"] === "en") { + tempLabel = { + "id": elem["@id"], + "language": "en", + "value": elem["rdfs:label"]["@value"] + }; + enLabelArray.push(tempLabel); + + tepmNodeContent = { + label: elem["rdfs:label"]["@value"], + contents: elem + }; + nodeContents.push(tepmNodeContent); + } - tepmNodeContent = {label:eachIds["@value"], contents:elem}; + tempLabelArray = elem["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempLabel = tempLabelArray1[tempLabelArray1.length - 1]; + + tepmNodeContent = { + label: tempLabel, + contents: elem + }; + nodeContents.push(tepmNodeContent); + } + } else { + tempLabelArray = elem["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempLabel = tempLabelArray1[tempLabelArray1.length - 1]; + + tepmNodeContent = { + label: tempLabel, + contents: elem + }; nodeContents.push(tepmNodeContent); - } - - tempLabelArray = elem["@id"].split('/'); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempLabel = tempLabelArray1[tempLabelArray1.length -1 ]; + } + + }); + //END :: get english and deutch labels values into arrays + + //returning label value + function getLabel(displayDeustch, id) { + var returnVaule = "noLabel" + if (!displayDeustch) { + enLabelArray.forEach(function(elem) { + if (elem["id"] === id) { + returnVaule = elem["value"]; + } + }); + } else if (displayDeustch) { + deLabelArray.forEach(function(elem) { + if (elem["id"] === id) { + returnVaule = elem["value"]; + } + }); + } + return returnVaule; + } - tepmNodeContent = {label:tempLabel, contents:elem}; - nodeContents.push(tepmNodeContent); - - }); + //crating node function + function createNewNode(tempSub, tempPred, tempObj, isLitteralVal, literalDataTypeVal) { + //START :: Node creation + var subNodeAdded = false; + var objNodeAdded = false; + + if (nodesArray != undefined) { + nodesArray.forEach(function(elem) { + if (elem["id"] === tempSub) { + subNodeAdded = true; + } + if (elem["id"] === tempObj) { + objNodeAdded = true; + } + }); } - else - { - if(elem["rdfs:label"]["@language"] === "de") - { - tempLabel = {"id":elem["@id"],"language":"de","value":elem["rdfs:label"]["@value"]}; - deLabelArray.push(tempLabel); - - tepmNodeContent = {label:elem["rdfs:label"]["@value"], contents:elem}; - nodeContents.push(tepmNodeContent); - } - if(elem["rdfs:label"]["@language"] === "en") - { - tempLabel = {"id":elem["@id"],"language":"en","value":elem["rdfs:label"]["@value"]}; - enLabelArray.push(tempLabel); - tepmNodeContent = {label:elem["rdfs:label"]["@value"], contents:elem}; - nodeContents.push(tepmNodeContent); - } - - tempLabelArray = elem["@id"].split("/"); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(":"); - tempLabel = tempLabelArray1[tempLabelArray1.length -1 ]; - - tepmNodeContent = {label:tempLabel, contents:elem}; - nodeContents.push(tepmNodeContent); - } - } - else - { - tempLabelArray = elem["@id"].split("/"); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempLabel = tempLabelArray1[tempLabelArray1.length -1 ]; - - tepmNodeContent = {label:tempLabel, contents:elem}; - nodeContents.push(tepmNodeContent); - } - - }); - //END :: get english and deutch labels values into arrays - - //START :: Creation of Graph depenging on displaySubclasses and dispalyAllprop values - var literalIndex = 0; - var circleIdIndex = 0; - var tempSub ="?"; - var tempPred ="?"; - var tempObj ="?"; - var pred="---subClassOf---"; - var tempDomainArray = []; - var tripleValue,isLitteral,literalDataType; - - data["@graph"].forEach(function(element) - { - tempSub ="?"; - tempPred ="?"; - tempObj ="?"; - pred="---subClassOf---"; - tempDomainArray = []; - //START :: Nodes and Links creation for subClassOf - if(displaySubclasses) - { - if(element["rdfs:subClassOf"] !== undefined) - { - tempSub = getLabel(displayDeustch,element["@id"]); - if(tempSub == "noLabel") - { - tempLabelArray = element["@id"].split('/'); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempSub = tempLabelArray1[tempLabelArray1.length -1 ]; - } + if (subNodeAdded === false) { + circleIdIndex = circleIdIndex + 1; + var nodeValue = { + id: tempSub, + predicate: tempPred, + nodeId: "circleId" + circleIdIndex, + isLitteral: false, + literalDataType: literalDataTypeVal, + group: 1 + }; + nodesArray.push(nodeValue); + } + if (objNodeAdded === false) { + circleIdIndex = circleIdIndex + 1; + var nodeValue = { + id: tempObj, + predicate: tempPred, + nodeId: "circleId" + circleIdIndex, + isLitteral: isLitteralVal, + literalDataType: literalDataTypeVal, + group: 1 + }; + nodesArray.push(nodeValue); + } + //END :: Node creation + } - if(Object.prototype.toString.call(element["rdfs:subClassOf"]) === "[object Array]") - { - element["rdfs:subClassOf"].forEach(function(eachIds) - { - tempObj = getLabel(displayDeustch,eachIds["@id"]); - if(tempObj == "noLabel") - { - tempLabelArray = eachIds["@id"].split('/'); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempObj = tempLabelArray1[tempLabelArray1.length -1 ]; + //START :: Creation of Graph depenging on displaySubclasses and dispalyAllprop values + var literalIndex = 0; + var circleIdIndex = 0; + var tempSub = "?"; + var tempPred = "?"; + var tempObj = "?"; + var pred = "---subClassOf---"; + var tempDomainArray = []; + var tripleValue, isLitteral, literalDataType; + + data["@graph"].forEach(function(element) { + tempSub = "?"; + tempPred = "?"; + tempObj = "?"; + pred = "---subClassOf---"; + tempDomainArray = []; + //START :: Nodes and Links creation for subClassOf + if (displaySubclasses) { + if (element["rdfs:subClassOf"] !== undefined) { + tempSub = getLabel(displayDeustch, element["@id"]); + if (tempSub == "noLabel") { + tempLabelArray = element["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempSub = tempLabelArray1[tempLabelArray1.length - 1]; } - tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; - linksArray.push(tripleValue); - - createNewNode(tempSub,pred,tempObj,false,''); - }); + if (Object.prototype.toString.call(element["rdfs:subClassOf"]) === "[object Array]") { + element["rdfs:subClassOf"].forEach(function(eachIds) { + tempObj = getLabel(displayDeustch, eachIds["@id"]); + if (tempObj == "noLabel") { + tempLabelArray = eachIds["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempObj = tempLabelArray1[tempLabelArray1.length - 1]; + } + + tripleValue = { + source: tempSub, + predicate: pred, + target: tempObj, + value: 1 + }; + linksArray.push(tripleValue); + + createNewNode(tempSub, pred, tempObj, false, ""); + }); + } else { + tempObj = getLabel(displayDeustch, element["rdfs:subClassOf"]["@id"]); + if (tempObj == "noLabel") { + tempLabelArray = element["rdfs:subClassOf"]["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempObj = tempLabelArray1[tempLabelArray1.length - 1]; + } + tripleValue = { + source: tempSub, + predicate: pred, + target: tempObj, + value: 1 + }; + linksArray.push(tripleValue); + + createNewNode(tempSub, pred, tempObj, false, " "); + } } - else - { - tempObj = getLabel(displayDeustch,element["rdfs:subClassOf"]["@id"]); - if(tempObj == "noLabel") - { - tempLabelArray = element["rdfs:subClassOf"]["@id"].split("/"); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempObj = tempLabelArray1[tempLabelArray1.length -1 ]; - } - tripleValue = {source:tempSub, predicate:pred, target:tempObj,value: 1}; - linksArray.push(tripleValue); + } + //END :: Nodes and Links creation for subClassOf - createNewNode(tempSub,pred,tempObj,false," "); + //START :: Nodes and Links creation for all Properties + if (dispalyAllprop) { + //get the subject label + if (element["rdfs:domain"] != undefined) { + if (Object.prototype.toString.call(element["rdfs:domain"]) === "[object Array]") { + element["rdfs:domain"].forEach(function(eachIds) { + tempDomainLabel = getLabel(displayDeustch, eachIds["@id"]); + if (tempDomainLabel == "noLabel") { + tempLabelArray = eachIds["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempDomainLabel = tempLabelArray1[tempLabelArray1.length - 1]; + } + tempDomainArray.push(tempDomainLabel); + }); + } else { + tempSub = getLabel(displayDeustch, element["rdfs:domain"]["@id"]); + if (tempSub == "noLabel") { + tempLabelArray = element["rdfs:domain"]["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempSub = tempLabelArray1[tempLabelArray1.length - 1]; + } + } } - } - } - //END :: Nodes and Links creation for subClassOf - - //START :: Nodes and Links creation for all Properties - if(dispalyAllprop) - { - //get the subject label - if(element["rdfs:domain"]!=undefined) - { - if(Object.prototype.toString.call(element["rdfs:domain"]) === '[object Array]') - { - element["rdfs:domain"].forEach(function(eachIds) - { - tempDomainLabel = getLabel(displayDeustch,eachIds["@id"]); - if(tempDomainLabel == "noLabel") - { - tempLabelArray = eachIds["@id"].split('/'); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempDomainLabel = tempLabelArray1[tempLabelArray1.length -1 ]; + + //get the predicate + if (element["rdfs:domain"] != undefined) { + tempPred = getLabel(displayDeustch, element["@id"]); + if (tempPred == "noLabel") { + tempLabelArray = element["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempPred = tempLabelArray1[tempLabelArray1.length - 1]; } - tempDomainArray.push(tempDomainLabel); - }); } - else - { - tempSub = getLabel(displayDeustch,element["rdfs:domain"]["@id"]); - if(tempSub == "noLabel") - { - tempLabelArray = element["rdfs:domain"]["@id"].split("/"); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempSub = tempLabelArray1[tempLabelArray1.length -1 ]; - } + + + //get the object range + if (element["rdfs:range"] != undefined) { + if ("@id" in element["rdfs:range"]) { + tempObj = getLabel(displayDeustch, element["rdfs:range"]["@id"]); + if (tempObj == "noLabel") { + tempLabelArray = element["rdfs:range"]["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempObj = tempLabelArray1[tempLabelArray1.length - 1]; + } + } } - } - - //get the predicate - if(element["rdfs:domain"]!=undefined) - { - tempPred = getLabel(displayDeustch,element["@id"]); - if(tempPred == "noLabel") - { - tempLabelArray = element["@id"].split('/'); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempPred = tempLabelArray1[tempLabelArray1.length -1 ]; + + isLitteral = false; + literalDataType = tempObj; + + if (tempObj.toLowerCase().includes("string") || tempObj.toLowerCase().includes("boolean") || tempObj.toLowerCase().includes("integer") || tempObj.toLowerCase().includes("datetime")) { + tempObj = tempObj + literalIndex; + literalIndex = literalIndex + 1; + isLitteral = true; } - } - - - //get the object range - if(element["rdfs:range"]!=undefined) - { - if ("@id" in element["rdfs:range"]) - { - tempObj = getLabel(displayDeustch,element["rdfs:range"]["@id"]); - if(tempObj == "noLabel") - { - tempLabelArray = element["rdfs:range"]["@id"].split('/'); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempObj = tempLabelArray1[tempLabelArray1.length -1 ]; - } - } - } - - isLitteral = false; - literalDataType = tempObj; - - if(tempObj.toLowerCase().includes("string") || tempObj.toLowerCase().includes("boolean")|| tempObj.toLowerCase().includes("integer") || tempObj.toLowerCase().includes("datetime")) - { - tempObj = tempObj + literalIndex; - literalIndex = literalIndex + 1 ; - isLitteral = true; - } - - if(tempDomainArray.length !==0) - { - tempDomainArray.forEach(function(el) - { - if(el != "?" && tempPred != "?" && tempObj != "?") - { - if(isLitteral) - { - tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; - linksArray.push(tripleValue); - createNewNode(el,tempPred,tempObj,isLitteral,literalDataType,element); - } - else - { - tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; - linksArray.push(tripleValue); - createNewNode(el,tempPred,tempObj,isLitteral,literalDataType); + + if (tempDomainArray.length !== 0) { + tempDomainArray.forEach(function(el) { + if (el != "?" && tempPred != "?" && tempObj != "?") { + if (isLitteral) { + tripleValue = { + source: el, + predicate: tempPred, + target: tempObj, + value: 1 + }; + linksArray.push(tripleValue); + createNewNode(el, tempPred, tempObj, isLitteral, literalDataType, element); + } else { + tripleValue = { + source: el, + predicate: tempPred, + target: tempObj, + value: 1 + }; + linksArray.push(tripleValue); + createNewNode(el, tempPred, tempObj, isLitteral, literalDataType); + } + } + }); + } else { + if (tempSub != "?" && tempPred != "?" && tempObj != "?") { + if (isLitteral) { + tripleValue = { + source: tempSub, + predicate: "", + target: tempPred, + value: 1 + }; + linksArray.push(tripleValue); + createNewNode(tempSub, "", tempPred, isLitteral, literalDataType); + } else { + tripleValue = { + source: tempSub, + predicate: tempPred, + target: tempObj, + value: 1 + }; + linksArray.push(tripleValue); + createNewNode(tempSub, tempPred, tempObj, isLitteral, literalDataType); + } } - } - }); - } - else - { - if(tempSub != "?" && tempPred != "?" && tempObj != "?") - { - if(isLitteral) - { - tripleValue = {source:tempSub, predicate:' ', target:tempPred,value: 1}; - linksArray.push(tripleValue); - createNewNode(tempSub,'',tempPred,isLitteral,literalDataType); - } - else - { - tripleValue = {source:tempSub, predicate:tempPred, target:tempObj,value: 1}; - linksArray.push(tripleValue); - createNewNode(tempSub,tempPred,tempObj,isLitteral,literalDataType); - } } - } - } - //END :: Nodes and Links creation for all Properties + } + //END :: Nodes and Links creation for all Properties }); //END :: Creation of Graph depenging on displaySubclasses and dispalyAllprop values if (error) { - return console.warn('Error in createV3RDFOntologyGraphView() method :'+error); + return console.warn("Error in createV3RDFOntologyGraphView() method :" + error); } - - - - function ticked() - { - lables - .attr("x2", function(d){ return d.x-width; }) - .attr("y2", function (d) {return d.y -height; }) - ; - link - .attr("x1", function(d) { return d.source.x; }) - .attr("y1", function(d) { return d.source.y; }) - .attr("x2", function(d) { return d.target.x; }) - .attr("y2", function(d) { return d.target.y; }) - ; - linkTexts - .attr("x", function(d) { - return 4 + (d.source.x + d.target.x)/2 ; }) - .attr("y", function(d) { - return 4 + (d.source.y + d.target.y)/2 ; }) - ; - node - .attr("transform", function(d) { - return "translate(" + d.x + "," + d.y + ")"; - }) - ; - if(applyNodesBoundary) - { - node - .attr("cx", function(d) { return d.x = Math.max(Math.max(resourceRadius,literalRadius), Math.min(width - Math.max(resourceRadius,literalRadius), d.x)); }) - .attr("cy", function(d) { return d.y = Math.max(Math.max(resourceRadius,literalRadius), Math.min(height - Math.max(resourceRadius,literalRadius), d.y)); }); - } - } - update(); - - - - function getLabel(displayDeustch,id) - { - var returnVaule = "noLabel" - if(!displayDeustch) - { - enLabelArray.forEach(function(elem) - { - if(elem["id"] === id) - { - returnVaule = elem["value"]; - } - }); - } - else if(displayDeustch) - { - deLabelArray.forEach(function(elem) - { - if(elem["id"] === id) - { - returnVaule = elem["value"]; - } - }); - } - return returnVaule; - } - function createNewNode(tempSub,tempPred,tempObj,isLitteralVal,literalDataTypeVal) - { - //START :: Node creation - var subNodeAdded = false; - var objNodeAdded = false; - - if(nodesArray != undefined) - { - nodesArray.forEach(function(elem) - { - if(elem["id"] === tempSub) - { - subNodeAdded = true; - } - if(elem["id"] === tempObj) - { - objNodeAdded = true; - } - }); - } - - if(subNodeAdded === false) - { - circleIdIndex =circleIdIndex+1; - var nodeValue = {id:tempSub ,predicate:tempPred,nodeId:"circleId"+circleIdIndex,isLitteral:false,literalDataType:literalDataTypeVal, group: 1}; - nodesArray.push(nodeValue); - } - if(objNodeAdded === false) - { - circleIdIndex =circleIdIndex+1; - var nodeValue = {id:tempObj ,predicate:tempPred,nodeId:"circleId"+circleIdIndex,isLitteral:isLitteralVal,literalDataType:literalDataTypeVal, group: 1}; - nodesArray.push(nodeValue); - } - //END :: Node creation - } - function clickFunctionality(d) - { - var idVal = "#"+d.nodeId; - var clickedNodeLabel = d.id; - if(expandedNodesArray.length === 0 || !expandedNodesArray.includes(idVal)) - { - expandedNodesArray.push(idVal); - - - d3.select(idVal) - .attr('r',resourceRadius+4) - .style("fill",customizeGraphArray.onClickNodeColor) - - var tempSub ="?"; - var tempPred ="?"; - var tempObj ="?"; - var pred="---subClassOf---"; - var tempDomainArray = []; - var includeThis,tempDomainLabel,tempLabelArray,tempLabelArray1,isLitteral,literalDataType,tripleValue; - - data["@graph"].forEach(function(element) - { - tempSub ="?"; - tempPred ="?"; - tempObj ="?"; - pred="---subClassOf---"; - tempDomainArray = []; - - includeThis = false; - //START :: Nodes and Links creation for all Properties - //get the subject label - if(element["rdfs:domain"]!=undefined) - { - if(Object.prototype.toString.call(element["rdfs:domain"]) === '[object Array]') - { - element["rdfs:domain"].forEach(function(eachIds) - { - tempDomainLabel = getLabel(displayDeustch,eachIds["@id"]); - if(tempDomainLabel == "noLabel") - { - tempLabelArray = eachIds["@id"].split('/'); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempDomainLabel = tempLabelArray1[tempLabelArray1.length -1 ]; - } - - if(clickedNodeLabel === tempDomainLabel) - { - includeThis = true; - tempDomainArray.push(tempDomainLabel); - } - + function ticked() { + lables + .attr("x2", function(d) { + return d.x - width; + }) + .attr("y2", function(d) { + return d.y - height; }); - } - else - { - tempSub = getLabel(displayDeustch,element["rdfs:domain"]["@id"]); - if(tempSub == "noLabel") - { - tempLabelArray = element["rdfs:domain"]["@id"].split('/'); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempSub = tempLabelArray1[tempLabelArray1.length -1 ]; - } - - if(clickedNodeLabel === tempSub) - { - includeThis = true; - } - } + link + .attr("x1", function(d) { + return d.source.x; + }) + .attr("y1", function(d) { + return d.source.y; + }) + .attr("x2", function(d) { + return d.target.x; + }) + .attr("y2", function(d) { + return d.target.y; + }); + linkTexts + .attr("x", function(d) { + return 4 + (d.source.x + d.target.x) / 2; + }) + .attr("y", function(d) { + return 4 + (d.source.y + d.target.y) / 2; + }); + node + .attr("transform", function(d) { + return "translate(" + d.x + "," + d.y + ")"; + }); + if (applyNodesBoundary) { + node + .attr("cx", function(d) { + return d.x = Math.max(Math.max(resourceRadius, literalRadius), Math.min(width - Math.max(resourceRadius, literalRadius), d.x)); + }) + .attr("cy", function(d) { + return d.y = Math.max(Math.max(resourceRadius, literalRadius), Math.min(height - Math.max(resourceRadius, literalRadius), d.y)); + }); } - - if(includeThis) - { - //get the predicate - if(element["rdfs:domain"]!=undefined) - { - tempPred = getLabel(displayDeustch,element["@id"]); - if(tempPred == "noLabel") - { - tempLabelArray = element["@id"].split('/'); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempPred = tempLabelArray1[tempLabelArray1.length -1 ]; - } - } - - //get the object range - if(element["rdfs:range"]!=undefined) - { - if ("@id" in element["rdfs:range"]) - { - tempObj = getLabel(displayDeustch,element["rdfs:range"]["@id"]); - if(tempObj === "noLabel") - { - tempLabelArray = element["rdfs:range"]["@id"].split('/'); - tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - tempObj = tempLabelArray1[tempLabelArray1.length -1 ]; - } - } - } - - isLitteral = false; - literalDataType = tempObj; - - if(tempObj.toLowerCase().includes("string") || tempObj.toLowerCase().includes("boolean")|| tempObj.toLowerCase().includes("integer") || tempObj.toLowerCase().includes("datetime")) - { - tempObj = tempObj + literalIndex; - literalIndex = literalIndex + 1 ; - isLitteral = true; - } - - if(!tempDomainArray.length ===0) - { - tempDomainArray.forEach(function(el) - { - if(el != "?" && tempPred != "?" && tempObj != "?") - { - if(isLitteral) - { - tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; - linksArray.push(tripleValue); - createNewNode(el,tempPred,tempObj,isLitteral,literalDataType,element); + } + + update(); + + + + + function clickFunctionality(d) { + var idVal = "#" + d.nodeId; + var clickedNodeLabel = d.id; + if (expandedNodesArray.length === 0 || !expandedNodesArray.includes(idVal)) { + expandedNodesArray.push(idVal); + + + d3.select(idVal) + .attr("r", resourceRadius + 4) + .style("fill", customizeGraphArray.onClickNodeColor) + + var tempSub = "?"; + var tempPred = "?"; + var tempObj = "?"; + var pred = "---subClassOf---"; + var tempDomainArray = []; + var includeThis, tempDomainLabel, tempLabelArray, tempLabelArray1, isLitteral, literalDataType, tripleValue; + + data["@graph"].forEach(function(element) { + tempSub = "?"; + tempPred = "?"; + tempObj = "?"; + pred = "---subClassOf---"; + tempDomainArray = []; + + includeThis = false; + //START :: Nodes and Links creation for all Properties + //get the subject label + if (element["rdfs:domain"] != undefined) { + if (Object.prototype.toString.call(element["rdfs:domain"]) === "[object Array]") { + element["rdfs:domain"].forEach(function(eachIds) { + tempDomainLabel = getLabel(displayDeustch, eachIds["@id"]); + if (tempDomainLabel == "noLabel") { + tempLabelArray = eachIds["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempDomainLabel = tempLabelArray1[tempLabelArray1.length - 1]; + } + + if (clickedNodeLabel === tempDomainLabel) { + includeThis = true; + tempDomainArray.push(tempDomainLabel); + } + + }); + } else { + tempSub = getLabel(displayDeustch, element["rdfs:domain"]["@id"]); + if (tempSub == "noLabel") { + tempLabelArray = element["rdfs:domain"]["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempSub = tempLabelArray1[tempLabelArray1.length - 1]; + } + + if (clickedNodeLabel === tempSub) { + includeThis = true; + } + } } - else - { - tripleValue = {source:el, predicate:tempPred, target:tempObj,value: 1}; - linksArray.push(tripleValue); - createNewNode(el,tempPred,tempObj,isLitteral,literalDataType); + + if (includeThis) { + //get the predicate + if (element["rdfs:domain"] != undefined) { + tempPred = getLabel(displayDeustch, element["@id"]); + if (tempPred == "noLabel") { + tempLabelArray = element["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempPred = tempLabelArray1[tempLabelArray1.length - 1]; + } + } + + //get the object range + if (element["rdfs:range"] != undefined) { + if ("@id" in element["rdfs:range"]) { + tempObj = getLabel(displayDeustch, element["rdfs:range"]["@id"]); + if (tempObj === "noLabel") { + tempLabelArray = element["rdfs:range"]["@id"].split("/"); + tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + tempObj = tempLabelArray1[tempLabelArray1.length - 1]; + } + } + } + + isLitteral = false; + literalDataType = tempObj; + + if (tempObj.toLowerCase().includes("string") || tempObj.toLowerCase().includes("boolean") || tempObj.toLowerCase().includes("integer") || tempObj.toLowerCase().includes("datetime")) { + tempObj = tempObj + literalIndex; + literalIndex = literalIndex + 1; + isLitteral = true; + } + + if (!tempDomainArray.length === 0) { + tempDomainArray.forEach(function(el) { + if (el != "?" && tempPred != "?" && tempObj != "?") { + if (isLitteral) { + tripleValue = { + source: el, + predicate: tempPred, + target: tempObj, + value: 1 + }; + linksArray.push(tripleValue); + createNewNode(el, tempPred, tempObj, isLitteral, literalDataType, element); + } else { + tripleValue = { + source: el, + predicate: tempPred, + target: tempObj, + value: 1 + }; + linksArray.push(tripleValue); + createNewNode(el, tempPred, tempObj, isLitteral, literalDataType); + } + } + }); + } else { + if (tempSub != "?" && tempPred != "?" && tempObj != "?") { + if (isLitteral) { + tripleValue = { + source: tempSub, + predicate: " ", + target: tempPred, + value: 1 + }; + linksArray.push(tripleValue); + createNewNode(tempSub, "", tempPred, isLitteral, literalDataType); + } else { + tripleValue = { + source: tempSub, + predicate: tempPred, + target: tempObj, + value: 1 + }; + linksArray.push(tripleValue); + createNewNode(tempSub, tempPred, tempObj, isLitteral, literalDataType); + } + } + } } - } + //END :: Nodes and Links creation for all Properties }); - } - else - { - if(tempSub != "?" && tempPred != "?" && tempObj != "?") - { - if(isLitteral) - { - tripleValue = {source:tempSub, predicate:' ', target:tempPred,value: 1}; - linksArray.push(tripleValue); - createNewNode(tempSub,'',tempPred,isLitteral,literalDataType); - } - else - { - tripleValue = {source:tempSub, predicate:tempPred, target:tempObj,value: 1}; - linksArray.push(tripleValue); - createNewNode(tempSub,tempPred,tempObj,isLitteral,literalDataType); - } - } - } - } - //END :: Nodes and Links creation for all Properties - }); - - var allClear = d3.selectAll(".everything"); - allClear.selectAll("*").remove(); - update(); - simulation.restart(); - } - else - { - d3.select(idVal) - .attr('r',resourceRadius) - .style("fill",'#311B92') + var allClear = d3.selectAll(".everything"); + allClear.selectAll("*").remove(); + + update(); + simulation.restart(); + } else { + d3.select(idVal) + .attr("r", resourceRadius) + .style("fill", "#311B92") - expandedNodesArray.pop(idVal); + expandedNodesArray.pop(idVal); + } } - } - - function update() { - simulation.restart(); - simulation - .nodes(nodesArray) - .on("tick", ticked) - ; - - simulation.force("link") - .links(linksArray) - ; - - - g = svg.append("g") - .attr("class", "everything"); - - link =g.selectAll("line") - .attr("class", "links") - .data(linksArray) - .enter().append("line") - .attr("class", "link") - .attr("stroke-width",1) - .style("fill","#999") - .attr("marker-end",function (d) { - var labelStr = d.predicate; - if(labelStr.includes('subClassOf')){return "url(#subclass)";} - return "url(#normal)"}) - .style("stroke-dasharray",function (d) { - var labelStr = d.predicate; - if(labelStr.includes('subClassOf')){return ("3, 3");} - if(labelStr.includes('subPropertyOf')){return ("5, 5");} - return ("0, 0");}); - ; - - link.exit().remove(); - // ==================== Add Link Names ===================== - linkTexts = g.selectAll(".link-text") + + function update() { + simulation.restart(); + simulation + .nodes(nodesArray) + .on("tick", ticked); + + simulation.force("link") + .links(linksArray); + + + g = svg.append("g") + .attr("class", "everything"); + + link = g.selectAll("line") + .attr("class", "links") + .data(linksArray) + .enter().append("line") + .attr("class", "link") + .attr("stroke-width", 1) + .style("fill", "#999") + .attr("marker-end", function(d) { + var labelStr = d.predicate; + if (labelStr.includes("subClassOf")) { + return "url(#subclass)"; + } + return "url(#normal)" + }) + .style("stroke-dasharray", function(d) { + var labelStr = d.predicate; + if (labelStr.includes("subClassOf")) { + return ("3, 3"); + } + if (labelStr.includes("subPropertyOf")) { + return ("5, 5"); + } + return ("0, 0"); + });; + + link.exit().remove(); + // ==================== Add Link Names ===================== + linkTexts = g.selectAll(".link-text") .data(linksArray) .enter() .append("text") - .attr("class", "link-text") - .text( function (d) { - var labelStr = d.predicate; - if(labelStr.includes('subClassOf')) - {return customizeGraphArray.subClassLabel;} - return d.predicate; }) - .style("fill",function(d){var labelStr = d.predicate; - if(labelStr.includes('subClassOf')) - {return customizeGraphArray.subClassLabelColor;} - return customizeGraphArray.propertyTextColor;}) - .style("font-size", "80%") - .style("font-style", "italic") - .attr('x', 12) - .attr('y', 3) - ; - - linkTexts.append("title") - .text(function(d) { - var labelStr = d.predicate; - if(labelStr.includes('subClassOf')) - { - var returnValue = 'Source : '+d.source +'\nProperty : '+customizeGraphArray.subClassLabel+'\nObject : '+d.target; + .attr("class", "link-text") + .text(function(d) { + var labelStr = d.predicate; + if (labelStr.includes("subClassOf")) { + return customizeGraphArray.subClassLabel; } - else - { - var returnValue = 'Source : '+d.source +'\nProperty : '+d.predicate+'\nObject : '+d.target; + return d.predicate; + }) + .style("fill", function(d) { + var labelStr = d.predicate; + if (labelStr.includes("subClassOf")) { + return customizeGraphArray.subClassLabelColor; + } + return customizeGraphArray.propertyTextColor; + }) + .style("font-size", "80%") + .style("font-style", "italic") + .attr("x", 12) + .attr("y", 3); + + linkTexts.append("title") + .text(function(d) { + var labelStr = d.predicate; + if (labelStr.includes("subClassOf")) { + var returnValue = "Source : " + d.source + "\nProperty : " + customizeGraphArray.subClassLabel + "\nObject : " + d.target; + } else { + var returnValue = "Source : " + d.source + "\nProperty : " + d.predicate + "\nObject : " + d.target; } - + return returnValue; - }); - ; - // ==================== Add Link Names ===================== - - node = g.append("g") - .attr("class", "nodes") - .selectAll("g") - .data(nodesArray) - .enter().append("g") - ; - node.exit().remove(); - - circles = node.append("circle") - .attr("id",function(d){return d.nodeId ;}) - .attr("r",function(d){var labelStr = d.id; - if(d.isLitteral) - {return literalRadius;} - return resourceRadius;}) - .style("fill",function(d){var labelStr = d.id; - if(d.isLitteral) - {return customizeGraphArray.literalNodeColor;} - return customizeGraphArray.resourceNodeColor;}) - .call(d3.drag() - .on("start", dragstarted) - .on("drag", dragged) - .on("end", dragended) - ); - - lables = node.append("text") - .attr("class", "node-text") - .text(function (d) {return d.id; }) - .style("font-size", function(d){var labelStr = d.id; - if(d.isLitteral) - {return "80%";} - return "100%";}) - .style("font-style", function(d){var labelStr = d.id; - if(d.isLitteral) - {return "italic";} - return "bold";}) - .style("fill",function(d){var labelStr = d.id; - if(d.isLitteral) - {return customizeGraphArray.literalNodeTextColor;} - return customizeGraphArray.resourceNodeTextColor;}) - .attr('x', function(d){ - if(d.isLitteral) - {return 8;} - return 12;}) - .attr('y', 3) - ; - - node.append("title") - .text(function(d) { - var returnValue = 'Node : '+d.id; - if(d.isLitteral){returnValue = 'Node : '+d.id +'\nData type : '+d.literalDataType;} - else{returnValue = 'Node : '+d.id;} - return returnValue; }) - ; - - //START :: on click - node.on("dblclick",clickFunctionality); - //END :: on click - - //START :: on double click - node.on("click",doubleClickFuntionality); - //END :: on double click - - - if(!disableZoom) - { - var zoom_handler = d3.zoom() - .on("zoom", zoom_actions); - //zoom_handler(svg); - //Zoom functions - svg.call(zoom_handler).on("dblclick.zoom", null); - function zoom_actions(){ - g.attr("transform", d3.event.transform) - - } + });; + // ==================== Add Link Names ===================== + + node = g.append("g") + .attr("class", "nodes") + .selectAll("g") + .data(nodesArray) + .enter().append("g"); + node.exit().remove(); + + circles = node.append("circle") + .attr("id", function(d) { + return d.nodeId; + }) + .attr("r", function(d) { + var labelStr = d.id; + if (d.isLitteral) { + return literalRadius; + } + return resourceRadius; + }) + .style("fill", function(d) { + var labelStr = d.id; + if (d.isLitteral) { + return customizeGraphArray.literalNodeColor; + } + return customizeGraphArray.resourceNodeColor; + }) + .call(d3.drag() + .on("start", dragstarted) + .on("drag", dragged) + .on("end", dragended) + ); + + lables = node.append("text") + .attr("class", "node-text") + .text(function(d) { + return d.id; + }) + .style("font-size", function(d) { + var labelStr = d.id; + if (d.isLitteral) { + return "80%"; + } + return "100%"; + }) + .style("font-style", function(d) { + var labelStr = d.id; + if (d.isLitteral) { + return "italic"; + } + return "bold"; + }) + .style("fill", function(d) { + var labelStr = d.id; + if (d.isLitteral) { + return customizeGraphArray.literalNodeTextColor; + } + return customizeGraphArray.resourceNodeTextColor; + }) + .attr("x", function(d) { + if (d.isLitteral) { + return 8; + } + return 12; + }) + .attr("y", 3); + + node.append("title") + .text(function(d) { + var returnValue = "Node : " + d.id; + if (d.isLitteral) { + returnValue = "Node : " + d.id + "\nData type : " + d.literalDataType; + } else { + returnValue = "Node : " + d.id; + } + return returnValue; + }); + + //START :: on click + node.on("dblclick", clickFunctionality); + //END :: on click + + //START :: on double click + node.on("click", doubleClickFuntionality); + //END :: on double click + + + if (!disableZoom) { + var zoom_handler = d3.zoom() + .on("zoom", zoom_actions); + //zoom_handler(svg); + //Zoom functions + svg.call(zoom_handler).on("dblclick.zoom", null); + + function zoom_actions() { + g.attr("transform", d3.event.transform) + + } + } + } - - } - function doubleClickFuntionality(d) - { - var nodeIdVal = d.id; - var tempNodeContains = []; - nodeContents.forEach(function(val){ - if(val.label == nodeIdVal) - { - tempNodeContains = val.contents - } - }); + function doubleClickFuntionality(d) { + var nodeIdVal = d.id; + var tempNodeContains = []; + nodeContents.forEach(function(val) { + if (val.label == nodeIdVal) { + tempNodeContains = val.contents + } + }); - var tempNode = d3.select("#"+idsArray.nodeId) - tempNode.selectAll("*").remove(); - tempNode.append("text") - .text(" " + nodeIdVal+"\n") - .style("font-style","italic") + var tempNode = d3.select("#" + idsArray.nodeId) + tempNode.selectAll("*").remove(); + tempNode.append("text") + .text(" " + nodeIdVal + "\n") + .style("font-style", "italic") .style("font-size", "80%") .style("position", "relative") - .style("bottom", "2px") - ; - - - //node label on double click - if(tempNodeContains != undefined) - { - var nodeLabel = d3.select("#"+idsArray.nodeLabelId) - nodeLabel.selectAll("*").remove(); - if(tempNodeContains["rdfs:label"] != undefined) - { - if(Object.prototype.toString.call(tempNodeContains["rdfs:label"]) === '[object Array]') - { - tempNodeContains["rdfs:label"].forEach(function(eachIds) - { - if(eachIds["@language"] == "de" && displayDeustch) - { - - nodeLabel.append("text") - .text(" " + eachIds["@value"] +"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - } - else if (eachIds["@language"] == "en" && !displayDeustch) - { - nodeLabel.append("text") - .text(" " + eachIds["@value"] +"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); + .style("bottom", "2px"); + + + //node label on double click + if (tempNodeContains != undefined) { + var nodeLabel = d3.select("#" + idsArray.nodeLabelId) + nodeLabel.selectAll("*").remove(); + if (tempNodeContains["rdfs:label"] != undefined) { + if (Object.prototype.toString.call(tempNodeContains["rdfs:label"]) === "[object Array]") { + tempNodeContains["rdfs:label"].forEach(function(eachIds) { + if (eachIds["@language"] == "de" && displayDeustch) { + + nodeLabel.append("text") + .text(" " + eachIds["@value"] + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + } else if (eachIds["@language"] == "en" && !displayDeustch) { + nodeLabel.append("text") + .text(" " + eachIds["@value"] + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + } + + }); + } else { + nodeLabel.append("text") + .text(" " + tempNodeContains["rdfs:label"]["@value"] + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + } } - - }); - } - else - { - nodeLabel.append("text") - .text(" " + tempNodeContains["rdfs:label"]["@value"] +"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - } - } - - //node id on double click - var nodeID = d3.select("#"+idsArray.nodeIdsId) - nodeID.selectAll("*").remove(); - if(tempNodeContains["@id"] != undefined ) - { - nodeID.append("text") - .text(" " + tempNodeContains["@id"]+"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - } - //node type on double click - var nodeType = d3.select("#"+idsArray.nodeTypeId) - nodeType.selectAll("*").remove(); - if(tempNodeContains["@type"] != undefined) - { - nodeType.append("text") - .text(" " + tempNodeContains["@type"]+"\n\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - } - - //node description on double click - var nodeDescription = d3.select("#"+idsArray.nodeDescripId) - nodeDescription.selectAll("*").remove(); - if(tempNodeContains["dc:description"] != undefined) - { - if(Object.prototype.toString.call(tempNodeContains["dc:description"]) === '[object Array]') - { - tempNodeContains["dc:description"].forEach(function(eachIds) - { - if(eachIds["@language"] == "de" && displayDeustch) - { - - nodeDescription.append("text") - .text(" " + eachIds["@value"] +"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); + + //node id on double click + var nodeID = d3.select("#" + idsArray.nodeIdsId) + nodeID.selectAll("*").remove(); + if (tempNodeContains["@id"] != undefined) { + nodeID.append("text") + .text(" " + tempNodeContains["@id"] + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); } - else if (eachIds["@language"] == "en" && !displayDeustch) - { - nodeDescription.append("text") - .text(" " + eachIds["@value"] +"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); + //node type on double click + var nodeType = d3.select("#" + idsArray.nodeTypeId) + nodeType.selectAll("*").remove(); + if (tempNodeContains["@type"] != undefined) { + nodeType.append("text") + .text(" " + tempNodeContains["@type"] + "\n\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); } - }); - } - else - { - nodeDescription.append("text") - .text(" " + tempNodeContains["dc:description"]["@value"] +"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - } - } - - var nodeSubClass = d3.select("#"+idsArray.nodeSubClassId) - nodeSubClass.selectAll("*").remove(); - if(tempNodeContains["rdfs:subClassOf"] != undefined) - { - if(Object.prototype.toString.call(tempNodeContains["rdfs:subClassOf"]) === '[object Array]') - { - var tempIndexSubClassof =1; - tempNodeContains["rdfs:subClassOf"].forEach(function(eachIds) - { - var subClassLabel = getLabel(displayDeustch,eachIds["@id"]); - if(subClassLabel == "noLabel") - { - var tempLabelArray = eachIds["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - subClassLabel = tempLabelArray1[tempLabelArray1.length -1 ]; + //node description on double click + var nodeDescription = d3.select("#" + idsArray.nodeDescripId) + nodeDescription.selectAll("*").remove(); + if (tempNodeContains["dc:description"] != undefined) { + if (Object.prototype.toString.call(tempNodeContains["dc:description"]) === "[object Array]") { + tempNodeContains["dc:description"].forEach(function(eachIds) { + if (eachIds["@language"] == "de" && displayDeustch) { + + nodeDescription.append("text") + .text(" " + eachIds["@value"] + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + } else if (eachIds["@language"] == "en" && !displayDeustch) { + nodeDescription.append("text") + .text(" " + eachIds["@value"] + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + } + + }); + } else { + nodeDescription.append("text") + .text(" " + tempNodeContains["dc:description"]["@value"] + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + } } - nodeSubClass.append("text") - .text(" " + tempIndexSubClassof +". "+ subClassLabel +"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - - tempIndexSubClassof = tempIndexSubClassof+1; - - }); - } - else - { - var subClassLabel = getLabel(displayDeustch,tempNodeContains["rdfs:subClassOf"]["@id"]); - if(subClassLabel == "noLabel") - { - var tempLabelArray = tempNodeContains["rdfs:subClassOf"]["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - subClassLabel = tempLabelArray1[tempLabelArray1.length -1 ]; - } - - nodeSubClass.append("text") - .text( " " + subClassLabel+"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - } - } - - var nodeDomain = d3.select("#"+idsArray.nodeDomainId) - nodeDomain.selectAll("*").remove(); - if(tempNodeContains["rdfs:domain"] != undefined ) - { - - if(Object.prototype.toString.call(tempNodeContains["rdfs:domain"]) === '[object Array]') - { - var tempIndexdomain =1; - tempNodeContains["rdfs:domain"].forEach(function(eachIds) - { - var domainLabel = getLabel(displayDeustch,eachIds["@id"]); - if(domainLabel == "noLabel") - { - var tempLabelArray = eachIds["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - domainLabel = tempLabelArray1[tempLabelArray1.length -1 ]; + var nodeSubClass = d3.select("#" + idsArray.nodeSubClassId) + nodeSubClass.selectAll("*").remove(); + if (tempNodeContains["rdfs:subClassOf"] != undefined) { + if (Object.prototype.toString.call(tempNodeContains["rdfs:subClassOf"]) === "[object Array]") { + var tempIndexSubClassof = 1; + tempNodeContains["rdfs:subClassOf"].forEach(function(eachIds) { + var subClassLabel = getLabel(displayDeustch, eachIds["@id"]); + if (subClassLabel == "noLabel") { + var tempLabelArray = eachIds["@id"].split("/"); + var tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + subClassLabel = tempLabelArray1[tempLabelArray1.length - 1]; + } + + nodeSubClass.append("text") + .text(" " + tempIndexSubClassof + ". " + subClassLabel + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + + tempIndexSubClassof = tempIndexSubClassof + 1; + + }); + } else { + var subClassLabel = getLabel(displayDeustch, tempNodeContains["rdfs:subClassOf"]["@id"]); + if (subClassLabel == "noLabel") { + var tempLabelArray = tempNodeContains["rdfs:subClassOf"]["@id"].split("/"); + var tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + subClassLabel = tempLabelArray1[tempLabelArray1.length - 1]; + } + + nodeSubClass.append("text") + .text(" " + subClassLabel + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + } } - nodeDomain.append("text") - .text(" " + tempIndexdomain +". "+ domainLabel +"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - - tempIndexdomain = tempIndexdomain+1; - - }); - } - else - { - var domainLabel = getLabel(displayDeustch,tempNodeContains["rdfs:domain"]["@id"]); - if(domainLabel == "noLabel") - { - var tempLabelArray = tempNodeContains["rdfs:domain"]["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - domainLabel = tempLabelArray1[tempLabelArray1.length -1 ]; - } - - nodeDomain.append("text") - .text(" " + domainLabel+"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - } - } + var nodeDomain = d3.select("#" + idsArray.nodeDomainId) + nodeDomain.selectAll("*").remove(); + if (tempNodeContains["rdfs:domain"] != undefined) { + + if (Object.prototype.toString.call(tempNodeContains["rdfs:domain"]) === "[object Array]") { + var tempIndexdomain = 1; + tempNodeContains["rdfs:domain"].forEach(function(eachIds) { + var domainLabel = getLabel(displayDeustch, eachIds["@id"]); + if (domainLabel == "noLabel") { + var tempLabelArray = eachIds["@id"].split("/"); + var tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + domainLabel = tempLabelArray1[tempLabelArray1.length - 1]; + } + + nodeDomain.append("text") + .text(" " + tempIndexdomain + ". " + domainLabel + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + + tempIndexdomain = tempIndexdomain + 1; + + }); + } else { + var domainLabel = getLabel(displayDeustch, tempNodeContains["rdfs:domain"]["@id"]); + if (domainLabel == "noLabel") { + var tempLabelArray = tempNodeContains["rdfs:domain"]["@id"].split("/"); + var tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + domainLabel = tempLabelArray1[tempLabelArray1.length - 1]; + } + + nodeDomain.append("text") + .text(" " + domainLabel + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + } + } - var nodeRange = d3.select("#"+idsArray.nodeRangeId) - nodeRange.selectAll("*").remove(); - if(tempNodeContains["rdfs:range"] != undefined ) - { - - if(Object.prototype.toString.call(tempNodeContains["rdfs:range"]) === '[object Array]') - { - var tempIndexRange =1; - tempNodeContains["rdfs:range"].forEach(function(eachIds) - { - var rangeLabel = getLabel(displayDeustch,eachIds["@id"]); - if(rangeLabel == "noLabel") - { - var tempLabelArray = eachIds["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - rangeLabel = tempLabelArray1[tempLabelArray1.length -1 ]; + var nodeRange = d3.select("#" + idsArray.nodeRangeId) + nodeRange.selectAll("*").remove(); + if (tempNodeContains["rdfs:range"] != undefined) { + + if (Object.prototype.toString.call(tempNodeContains["rdfs:range"]) === "[object Array]") { + var tempIndexRange = 1; + tempNodeContains["rdfs:range"].forEach(function(eachIds) { + var rangeLabel = getLabel(displayDeustch, eachIds["@id"]); + if (rangeLabel == "noLabel") { + var tempLabelArray = eachIds["@id"].split("/"); + var tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + rangeLabel = tempLabelArray1[tempLabelArray1.length - 1]; + } + + nodeRange.append("text") + .text(" " + tempIndexRange + ". " + rangeLabel + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + + tempIndexRange = tempIndexRange + 1; + + }); + } else { + var rangeLabel = getLabel(displayDeustch, tempNodeContains["rdfs:range"]["@id"]); + if (rangeLabel == "noLabel") { + var tempLabelArray = tempNodeContains["rdfs:range"]["@id"].split("/"); + var tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); + rangeLabel = tempLabelArray1[tempLabelArray1.length - 1]; + } + + nodeRange.append("text") + .text(" " + rangeLabel + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + } } - nodeRange.append("text") - .text(" " + tempIndexRange +". "+ rangeLabel +"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - - tempIndexRange = tempIndexRange+1; + var nodeComment = d3.select("#" + idsArray.nodeCommentId) + nodeComment.selectAll("*").remove(); + if (tempNodeContains["rdfs:comment"] != undefined) { + nodeComment.append("text") + .text(tempNodeContains["rdfs:comment"] + "\n") + .style("font-style", "italic") + .style("font-size", "80%") + .style("position", "relative") + .style("bottom", "2px"); + } - }); } - else - { - var rangeLabel = getLabel(displayDeustch,tempNodeContains["rdfs:range"]["@id"]); - if(rangeLabel == "noLabel") - { - var tempLabelArray = tempNodeContains["rdfs:range"]["@id"].split('/'); - var tempLabelArray1 = tempLabelArray[tempLabelArray.length -1 ].split(':'); - rangeLabel = tempLabelArray1[tempLabelArray1.length -1 ]; - } - - nodeRange.append("text") - .text(" " + rangeLabel+"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - } - } - - var nodeComment = d3.select("#"+idsArray.nodeCommentId) - nodeComment.selectAll("*").remove(); - if(tempNodeContains["rdfs:comment"] != undefined) - { - nodeComment.append("text") - .text(tempNodeContains["rdfs:comment"]+"\n") - .style("font-style","italic") - .style("font-size", "80%") - .style("position", "relative") - .style("bottom", "2px"); - } } - - } }); - + function dragstarted(d) { - if (!d3.event.active) simulation.alphaTarget(0.3).restart(); - d.fx = d.x; - d.fy = d.y; + if (!d3.event.active) simulation.alphaTarget(0.3).restart(); + d.fx = d.x; + d.fy = d.y; } function dragged(d) { - d.fx = d3.event.x; - d.fy = d3.event.y; + d.fx = d3.event.x; + d.fy = d3.event.y; } function dragended(d) { - if (!d3.event.active) simulation.alphaTarget(0); - d.fx = null; - d.fy = null; + if (!d3.event.active) simulation.alphaTarget(0); + d.fx = null; + d.fy = null; } - -}; + +}; \ No newline at end of file From 58439cc084b19250c380e941d1b7f2c67519046c Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Thu, 4 Jul 2019 16:58:31 +0200 Subject: [PATCH 36/66] resolve Codacy/PR Quality Review issues --- .../d3v4-rdf-ontology-graph-view.js | 106 +++++++++--------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index 90cb28248..2058bd5fe 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -59,8 +59,19 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa .force("center", d3.forceCenter((width / 2), (height / 2))); var tempLabel, tepmNodeContent, tempLabelArray, tempLabelArray1; + var literalIndex = 0; + var circleIdIndex = 0; + var tempSub = "?"; + var tempPred = "?"; + var tempObj = "?"; + var pred = "---subClassOf---"; + var tempDomainArray = []; + var tripleValue, isLitteral, literalDataType; d3.json("assets/rdfontology/historian-onlogoly.json", function(error, data) { + if (error) { + return console.warn("Error in createV3RDFOntologyGraphView() method :" + error); + } //START :: get english and deutsch labels values into arrays data["@graph"].forEach(function(elem) { if (elem["rdfs:label"] !== undefined) { @@ -164,7 +175,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa //returning label value function getLabel(displayDeustch, id) { - var returnVaule = "noLabel" + var returnVaule = "noLabel"; if (!displayDeustch) { enLabelArray.forEach(function(elem) { if (elem["id"] === id) { @@ -188,7 +199,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa var subNodeAdded = false; var objNodeAdded = false; - if (nodesArray != undefined) { + if (nodesArray !== undefined) { nodesArray.forEach(function(elem) { if (elem["id"] === tempSub) { subNodeAdded = true; @@ -227,14 +238,6 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa } //START :: Creation of Graph depenging on displaySubclasses and dispalyAllprop values - var literalIndex = 0; - var circleIdIndex = 0; - var tempSub = "?"; - var tempPred = "?"; - var tempObj = "?"; - var pred = "---subClassOf---"; - var tempDomainArray = []; - var tripleValue, isLitteral, literalDataType; data["@graph"].forEach(function(element) { tempSub = "?"; @@ -246,7 +249,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa if (displaySubclasses) { if (element["rdfs:subClassOf"] !== undefined) { tempSub = getLabel(displayDeustch, element["@id"]); - if (tempSub == "noLabel") { + if (tempSub === "noLabel") { tempLabelArray = element["@id"].split("/"); tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); tempSub = tempLabelArray1[tempLabelArray1.length - 1]; @@ -255,7 +258,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa if (Object.prototype.toString.call(element["rdfs:subClassOf"]) === "[object Array]") { element["rdfs:subClassOf"].forEach(function(eachIds) { tempObj = getLabel(displayDeustch, eachIds["@id"]); - if (tempObj == "noLabel") { + if (tempObj === "noLabel") { tempLabelArray = eachIds["@id"].split("/"); tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); tempObj = tempLabelArray1[tempLabelArray1.length - 1]; @@ -273,7 +276,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa }); } else { tempObj = getLabel(displayDeustch, element["rdfs:subClassOf"]["@id"]); - if (tempObj == "noLabel") { + if (tempObj === "noLabel") { tempLabelArray = element["rdfs:subClassOf"]["@id"].split("/"); tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); tempObj = tempLabelArray1[tempLabelArray1.length - 1]; @@ -295,11 +298,11 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa //START :: Nodes and Links creation for all Properties if (dispalyAllprop) { //get the subject label - if (element["rdfs:domain"] != undefined) { + if (element["rdfs:domain"] !== undefined) { if (Object.prototype.toString.call(element["rdfs:domain"]) === "[object Array]") { element["rdfs:domain"].forEach(function(eachIds) { tempDomainLabel = getLabel(displayDeustch, eachIds["@id"]); - if (tempDomainLabel == "noLabel") { + if (tempDomainLabel === "noLabel") { tempLabelArray = eachIds["@id"].split("/"); tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); tempDomainLabel = tempLabelArray1[tempLabelArray1.length - 1]; @@ -308,7 +311,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa }); } else { tempSub = getLabel(displayDeustch, element["rdfs:domain"]["@id"]); - if (tempSub == "noLabel") { + if (tempSub === "noLabel") { tempLabelArray = element["rdfs:domain"]["@id"].split("/"); tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); tempSub = tempLabelArray1[tempLabelArray1.length - 1]; @@ -317,9 +320,9 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa } //get the predicate - if (element["rdfs:domain"] != undefined) { + if (element["rdfs:domain"] !== undefined) { tempPred = getLabel(displayDeustch, element["@id"]); - if (tempPred == "noLabel") { + if (tempPred === "noLabel") { tempLabelArray = element["@id"].split("/"); tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); tempPred = tempLabelArray1[tempLabelArray1.length - 1]; @@ -328,10 +331,10 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa //get the object range - if (element["rdfs:range"] != undefined) { + if (element["rdfs:range"] !== undefined) { if ("@id" in element["rdfs:range"]) { tempObj = getLabel(displayDeustch, element["rdfs:range"]["@id"]); - if (tempObj == "noLabel") { + if (tempObj === "noLabel") { tempLabelArray = element["rdfs:range"]["@id"].split("/"); tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); tempObj = tempLabelArray1[tempLabelArray1.length - 1]; @@ -350,7 +353,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa if (tempDomainArray.length !== 0) { tempDomainArray.forEach(function(el) { - if (el != "?" && tempPred != "?" && tempObj != "?") { + if (el !== "?" && tempPred !== "?" && tempObj !== "?") { if (isLitteral) { tripleValue = { source: el, @@ -373,7 +376,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa } }); } else { - if (tempSub != "?" && tempPred != "?" && tempObj != "?") { + if (tempSub !== "?" && tempPred !== "?" && tempObj !== "?") { if (isLitteral) { tripleValue = { source: tempSub, @@ -400,10 +403,6 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa }); //END :: Creation of Graph depenging on displaySubclasses and dispalyAllprop values - if (error) { - return console.warn("Error in createV3RDFOntologyGraphView() method :" + error); - } - @@ -464,7 +463,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa d3.select(idVal) .attr("r", resourceRadius + 4) - .style("fill", customizeGraphArray.onClickNodeColor) + .style("fill", customizeGraphArray.onClickNodeColor); var tempSub = "?"; var tempPred = "?"; @@ -483,11 +482,11 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa includeThis = false; //START :: Nodes and Links creation for all Properties //get the subject label - if (element["rdfs:domain"] != undefined) { + if (element["rdfs:domain"] !== undefined) { if (Object.prototype.toString.call(element["rdfs:domain"]) === "[object Array]") { element["rdfs:domain"].forEach(function(eachIds) { tempDomainLabel = getLabel(displayDeustch, eachIds["@id"]); - if (tempDomainLabel == "noLabel") { + if (tempDomainLabel === "noLabel") { tempLabelArray = eachIds["@id"].split("/"); tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); tempDomainLabel = tempLabelArray1[tempLabelArray1.length - 1]; @@ -501,7 +500,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa }); } else { tempSub = getLabel(displayDeustch, element["rdfs:domain"]["@id"]); - if (tempSub == "noLabel") { + if (tempSub === "noLabel") { tempLabelArray = element["rdfs:domain"]["@id"].split("/"); tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); tempSub = tempLabelArray1[tempLabelArray1.length - 1]; @@ -515,9 +514,9 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa if (includeThis) { //get the predicate - if (element["rdfs:domain"] != undefined) { + if (element["rdfs:domain"] !== undefined) { tempPred = getLabel(displayDeustch, element["@id"]); - if (tempPred == "noLabel") { + if (tempPred === "noLabel") { tempLabelArray = element["@id"].split("/"); tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); tempPred = tempLabelArray1[tempLabelArray1.length - 1]; @@ -525,7 +524,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa } //get the object range - if (element["rdfs:range"] != undefined) { + if (element["rdfs:range"] !== undefined) { if ("@id" in element["rdfs:range"]) { tempObj = getLabel(displayDeustch, element["rdfs:range"]["@id"]); if (tempObj === "noLabel") { @@ -547,7 +546,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa if (!tempDomainArray.length === 0) { tempDomainArray.forEach(function(el) { - if (el != "?" && tempPred != "?" && tempObj != "?") { + if (el !== "?" && tempPred !== "?" && tempObj !== "?") { if (isLitteral) { tripleValue = { source: el, @@ -570,7 +569,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa } }); } else { - if (tempSub != "?" && tempPred != "?" && tempObj != "?") { + if (tempSub !== "?" && tempPred !== "?" && tempObj !== "?") { if (isLitteral) { tripleValue = { source: tempSub, @@ -605,7 +604,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa } else { d3.select(idVal) .attr("r", resourceRadius) - .style("fill", "#311B92") + .style("fill", "#311B92"); expandedNodesArray.pop(idVal); } @@ -636,7 +635,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa if (labelStr.includes("subClassOf")) { return "url(#subclass)"; } - return "url(#normal)" + return "url(#normal)"; }) .style("stroke-dasharray", function(d) { var labelStr = d.predicate; @@ -678,14 +677,15 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa linkTexts.append("title") .text(function(d) { var labelStr = d.predicate; + var returnValue; if (labelStr.includes("subClassOf")) { - var returnValue = "Source : " + d.source + "\nProperty : " + customizeGraphArray.subClassLabel + "\nObject : " + d.target; + returnValue = "Source : " + d.source + "\nProperty : " + customizeGraphArray.subClassLabel + "\nObject : " + d.target; } else { - var returnValue = "Source : " + d.source + "\nProperty : " + d.predicate + "\nObject : " + d.target; + returnValue = "Source : " + d.source + "\nProperty : " + d.predicate + "\nObject : " + d.target; } return returnValue; - });; + }); // ==================== Add Link Names ===================== node = g.append("g") @@ -809,10 +809,10 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa //node label on double click - if (tempNodeContains != undefined) { + if (tempNodeContains !== undefined) { var nodeLabel = d3.select("#" + idsArray.nodeLabelId) nodeLabel.selectAll("*").remove(); - if (tempNodeContains["rdfs:label"] != undefined) { + if (tempNodeContains["rdfs:label"] !== undefined) { if (Object.prototype.toString.call(tempNodeContains["rdfs:label"]) === "[object Array]") { tempNodeContains["rdfs:label"].forEach(function(eachIds) { if (eachIds["@language"] == "de" && displayDeustch) { @@ -846,7 +846,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa //node id on double click var nodeID = d3.select("#" + idsArray.nodeIdsId) nodeID.selectAll("*").remove(); - if (tempNodeContains["@id"] != undefined) { + if (tempNodeContains["@id"] !== undefined) { nodeID.append("text") .text(" " + tempNodeContains["@id"] + "\n") .style("font-style", "italic") @@ -857,7 +857,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa //node type on double click var nodeType = d3.select("#" + idsArray.nodeTypeId) nodeType.selectAll("*").remove(); - if (tempNodeContains["@type"] != undefined) { + if (tempNodeContains["@type"] !== undefined) { nodeType.append("text") .text(" " + tempNodeContains["@type"] + "\n\n") .style("font-style", "italic") @@ -869,7 +869,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa //node description on double click var nodeDescription = d3.select("#" + idsArray.nodeDescripId) nodeDescription.selectAll("*").remove(); - if (tempNodeContains["dc:description"] != undefined) { + if (tempNodeContains["dc:description"] !== undefined) { if (Object.prototype.toString.call(tempNodeContains["dc:description"]) === "[object Array]") { tempNodeContains["dc:description"].forEach(function(eachIds) { if (eachIds["@language"] == "de" && displayDeustch) { @@ -902,7 +902,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa var nodeSubClass = d3.select("#" + idsArray.nodeSubClassId) nodeSubClass.selectAll("*").remove(); - if (tempNodeContains["rdfs:subClassOf"] != undefined) { + if (tempNodeContains["rdfs:subClassOf"] !== undefined) { if (Object.prototype.toString.call(tempNodeContains["rdfs:subClassOf"]) === "[object Array]") { var tempIndexSubClassof = 1; tempNodeContains["rdfs:subClassOf"].forEach(function(eachIds) { @@ -942,13 +942,13 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa var nodeDomain = d3.select("#" + idsArray.nodeDomainId) nodeDomain.selectAll("*").remove(); - if (tempNodeContains["rdfs:domain"] != undefined) { + if (tempNodeContains["rdfs:domain"] !== undefined) { if (Object.prototype.toString.call(tempNodeContains["rdfs:domain"]) === "[object Array]") { var tempIndexdomain = 1; tempNodeContains["rdfs:domain"].forEach(function(eachIds) { var domainLabel = getLabel(displayDeustch, eachIds["@id"]); - if (domainLabel == "noLabel") { + if (domainLabel === "noLabel") { var tempLabelArray = eachIds["@id"].split("/"); var tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); domainLabel = tempLabelArray1[tempLabelArray1.length - 1]; @@ -966,7 +966,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa }); } else { var domainLabel = getLabel(displayDeustch, tempNodeContains["rdfs:domain"]["@id"]); - if (domainLabel == "noLabel") { + if (domainLabel === "noLabel") { var tempLabelArray = tempNodeContains["rdfs:domain"]["@id"].split("/"); var tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); domainLabel = tempLabelArray1[tempLabelArray1.length - 1]; @@ -984,13 +984,13 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa var nodeRange = d3.select("#" + idsArray.nodeRangeId) nodeRange.selectAll("*").remove(); - if (tempNodeContains["rdfs:range"] != undefined) { + if (tempNodeContains["rdfs:range"] !== undefined) { if (Object.prototype.toString.call(tempNodeContains["rdfs:range"]) === "[object Array]") { var tempIndexRange = 1; tempNodeContains["rdfs:range"].forEach(function(eachIds) { var rangeLabel = getLabel(displayDeustch, eachIds["@id"]); - if (rangeLabel == "noLabel") { + if (rangeLabel === "noLabel") { var tempLabelArray = eachIds["@id"].split("/"); var tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); rangeLabel = tempLabelArray1[tempLabelArray1.length - 1]; @@ -1008,7 +1008,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa }); } else { var rangeLabel = getLabel(displayDeustch, tempNodeContains["rdfs:range"]["@id"]); - if (rangeLabel == "noLabel") { + if (rangeLabel === "noLabel") { var tempLabelArray = tempNodeContains["rdfs:range"]["@id"].split("/"); var tempLabelArray1 = tempLabelArray[tempLabelArray.length - 1].split(":"); rangeLabel = tempLabelArray1[tempLabelArray1.length - 1]; @@ -1025,7 +1025,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa var nodeComment = d3.select("#" + idsArray.nodeCommentId) nodeComment.selectAll("*").remove(); - if (tempNodeContains["rdfs:comment"] != undefined) { + if (tempNodeContains["rdfs:comment"] !== undefined) { nodeComment.append("text") .text(tempNodeContains["rdfs:comment"] + "\n") .style("font-style", "italic") From c980bfa2414a2dc4a37e7ebff0f9e72f05c4ca75 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Thu, 4 Jul 2019 16:59:41 +0200 Subject: [PATCH 37/66] resolve Codacy/PR Quality Review issues --- ida-chatbot/src/app/app.module.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ida-chatbot/src/app/app.module.ts b/ida-chatbot/src/app/app.module.ts index 1f43aecfc..6436d8b59 100644 --- a/ida-chatbot/src/app/app.module.ts +++ b/ida-chatbot/src/app/app.module.ts @@ -62,7 +62,7 @@ import { VennViewComponent } from './components/venn-view/venn-view.component'; import { RdfOntologyViewComponent } from './components/rdf-ontology-view/rdf-ontology-view.component'; import { DeckglHexViewComponent } from './components/deckgl-hex-view/deckgl-hex-view.component'; import { SpeechInputComponent } from './components/speech-input/speech-input.component'; -//import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ declarations: [ AppComponent, @@ -124,8 +124,8 @@ import { SpeechInputComponent } from './components/speech-input/speech-input.com MatTabsModule, MatToolbarModule, MatTooltipModule, - FlexLayoutModule//, - //NgbModule + FlexLayoutModule, + NgbModule ], providers: [{ provide: HTTP_INTERCEPTORS, From c7725b4ca2059f23e82eb108fe72164730bb9e40 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Tue, 22 Oct 2019 15:05:21 +0200 Subject: [PATCH 38/66] changing svg id value in component html and starting use of Angular material. --- .../rdf-ontology-view.component.html | 2 +- .../rdf-ontology-view.component.ts | 12 +++++------ .../d3v4-rdf-ontology-graph-view.js | 20 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index a238df0a1..7bcbdcfcf 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -185,7 +185,7 @@

Historian Ontology Graph

-
+
\ No newline at end of file diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts index 021fefee9..06d75d721 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.ts @@ -10,7 +10,7 @@ declare function createV4RDFOntologyGraph(a, b,c,d,e,f,g,h,j,i); export class RdfOntologyViewComponent implements OnInit { public figId: string; - public svgId: string; + public ontologyId: string; public fileName: string; public nodeId: string; public nodeLabelId: string; @@ -42,7 +42,7 @@ export class RdfOntologyViewComponent implements OnInit { constructor(public uip: UniqueIdProviderService) { this.figId = 'fig' + this.uip.getUniqueId(); - this.svgId = 'svg' + this.uip.getUniqueId(); + this.ontologyId = 'ontologyId' + this.uip.getUniqueId(); this.nodeId = 'nodeLabelId' + this.uip.getUniqueId(); this.nodeLabelId = 'nodeLabelId' + this.uip.getUniqueId(); this.nodeIdsId = 'nodeIdsId' + this.uip.getUniqueId(); @@ -77,7 +77,7 @@ export class RdfOntologyViewComponent implements OnInit { propertyTextColor:this.propertyTextColor, onClickNodeColor:this.onClickNodeColor } - createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked, + createV4RDFOntologyGraph(this.figId, this.ontologyId,this.fileName,this.languageCheked,this.classHeirarchyChecked, this.allPropChecked,this.allNodesInBoundClicked,this.disableZoomClicked,idVal,customizeGraphVals); } @@ -99,7 +99,7 @@ export class RdfOntologyViewComponent implements OnInit { propertyTextColor:this.propertyTextColor, onClickNodeColor:this.onClickNodeColor } - createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked, + createV4RDFOntologyGraph(this.figId, this.ontologyId,this.fileName,this.languageCheked,this.classHeirarchyChecked, this.allPropChecked,this.allNodesInBoundClicked,this.disableZoomClicked,idVal,customizeGraphVals); } graphResetChanged(event){ @@ -141,7 +141,7 @@ export class RdfOntologyViewComponent implements OnInit { onClickNodeColor:this.onClickNodeColor } - createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked, + createV4RDFOntologyGraph(this.figId, this.ontologyId,this.fileName,this.languageCheked,this.classHeirarchyChecked, this.allPropChecked,this.allNodesInBoundClicked,this.disableZoomClicked,idVal,customizeGraphVals); } @@ -164,7 +164,7 @@ export class RdfOntologyViewComponent implements OnInit { propertyTextColor:this.propertyTextColor, onClickNodeColor:this.onClickNodeColor } - createV4RDFOntologyGraph(this.figId, this.svgId,this.fileName,this.languageCheked,this.classHeirarchyChecked, + createV4RDFOntologyGraph(this.figId, this.ontologyId,this.fileName,this.languageCheked,this.classHeirarchyChecked, this.allPropChecked,this.allNodesInBoundClicked, this.disableZoomClicked,idVal,customizeGraphVals); } diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index 2058bd5fe..9654dc08a 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -7,7 +7,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa var expandedNodesArray = []; var nodeContents = []; - var width = 1025, + var width = 1175, height = 1100, resourceRadius = customizeGraphArray.resourceRadius, literalRadius = customizeGraphArray.literalRadius; @@ -454,7 +454,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa - function clickFunctionality(d) { + function doubleClickFunctionality(d) { var idVal = "#" + d.nodeId; var clickedNodeLabel = d.id; if (expandedNodesArray.length === 0 || !expandedNodesArray.includes(idVal)) { @@ -465,7 +465,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa .attr("r", resourceRadius + 4) .style("fill", customizeGraphArray.onClickNodeColor); - var tempSub = "?"; + var tempSub = "?"; var tempPred = "?"; var tempObj = "?"; var pred = "---subClassOf---"; @@ -764,13 +764,13 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa return returnValue; }); - //START :: on click - node.on("dblclick", clickFunctionality); - //END :: on click - //START :: on double click - node.on("click", doubleClickFuntionality); - //END :: on double click + node.on("dblclick", doubleClickFunctionality); + //END :: on double click + + //START :: on click + node.on("click", clickFuntionality); + //END :: on click if (!disableZoom) { @@ -789,7 +789,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa } - function doubleClickFuntionality(d) { + function clickFuntionality(d) { var nodeIdVal = d.id; var tempNodeContains = []; nodeContents.forEach(function(val) { From 6bdc036e0962bc484ace623c5edf08cad28aca35 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Fri, 1 Nov 2019 15:38:43 +0100 Subject: [PATCH 39/66] implemented functionality of collapsing nodes and links that are expanded on Double click of a node. --- .../d3v4-rdf-ontology-graph-view.js | 124 +++++++++++++++--- 1 file changed, 109 insertions(+), 15 deletions(-) diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index 9654dc08a..d8886eeef 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -6,6 +6,10 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa var deLabelArray = []; var expandedNodesArray = []; var nodeContents = []; + var onDoubleClickedNewlyCreatedNodes = []; + var onDoubleClickedNewlyCreatedLinks = []; + var onDoubleClickCreatingNodes = false; + var nodeDoubleClicked = ""; var width = 1175, height = 1100, @@ -198,6 +202,7 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa //START :: Node creation var subNodeAdded = false; var objNodeAdded = false; + var onDoubleClickNodesCreated = ""; if (nodesArray !== undefined) { nodesArray.forEach(function(elem) { @@ -221,6 +226,12 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa group: 1 }; nodesArray.push(nodeValue); + + if(onDoubleClickCreatingNodes) + { + onDoubleClickNodesCreated = {nodeClicked:nodeDoubleClicked,nodeCreated:nodeValue}; + onDoubleClickedNewlyCreatedNodes.push(onDoubleClickNodesCreated); + } } if (objNodeAdded === false) { circleIdIndex = circleIdIndex + 1; @@ -233,6 +244,11 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa group: 1 }; nodesArray.push(nodeValue); + if(onDoubleClickCreatingNodes) + { + onDoubleClickNodesCreated = {nodeClicked:nodeDoubleClicked,nodeCreated:nodeValue}; + onDoubleClickedNewlyCreatedNodes.push(onDoubleClickNodesCreated); + } } //END :: Node creation } @@ -271,7 +287,6 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa value: 1 }; linksArray.push(tripleValue); - createNewNode(tempSub, pred, tempObj, false, ""); }); } else { @@ -403,9 +418,6 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa }); //END :: Creation of Graph depenging on displaySubclasses and dispalyAllprop values - - - function ticked() { lables .attr("x2", function(d) { @@ -452,11 +464,11 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa update(); - - function doubleClickFunctionality(d) { var idVal = "#" + d.nodeId; var clickedNodeLabel = d.id; + var newlyCreatingLinkData = ""; + if (expandedNodesArray.length === 0 || !expandedNodesArray.includes(idVal)) { expandedNodesArray.push(idVal); @@ -470,7 +482,10 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa var tempObj = "?"; var pred = "---subClassOf---"; var tempDomainArray = []; - var includeThis, tempDomainLabel, tempLabelArray, tempLabelArray1, isLitteral, literalDataType, tripleValue; + var includeThis, tempDomainLabel, tempLabelArray, tempLabelArray1, isLitteral, literalDataType, tripleValue,removeClikedNode; + + onDoubleClickCreatingNodes = true; + nodeDoubleClicked = idVal; data["@graph"].forEach(function(element) { tempSub = "?"; @@ -555,6 +570,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa value: 1 }; linksArray.push(tripleValue); + newlyCreatingLinkData = {nodeClicked:idVal,link:tripleValue}; + onDoubleClickedNewlyCreatedLinks.push(newlyCreatingLinkData); createNewNode(el, tempPred, tempObj, isLitteral, literalDataType, element); } else { tripleValue = { @@ -564,6 +581,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa value: 1 }; linksArray.push(tripleValue); + newlyCreatingLinkData = {nodeClicked:idVal,link:tripleValue}; + onDoubleClickedNewlyCreatedLinks.push(newlyCreatingLinkData); createNewNode(el, tempPred, tempObj, isLitteral, literalDataType); } } @@ -578,6 +597,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa value: 1 }; linksArray.push(tripleValue); + newlyCreatingLinkData = {nodeClicked:idVal,link:tripleValue}; + onDoubleClickedNewlyCreatedLinks.push(newlyCreatingLinkData); createNewNode(tempSub, "", tempPred, isLitteral, literalDataType); } else { tripleValue = { @@ -587,6 +608,8 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa value: 1 }; linksArray.push(tripleValue); + newlyCreatingLinkData = {nodeClicked:idVal,link:tripleValue}; + onDoubleClickedNewlyCreatedLinks.push(newlyCreatingLinkData); createNewNode(tempSub, tempPred, tempObj, isLitteral, literalDataType); } } @@ -594,24 +617,95 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa } //END :: Nodes and Links creation for all Properties }); + + onDoubleClickCreatingNodes = false; var allClear = d3.selectAll(".everything"); allClear.selectAll("*").remove(); update(); simulation.restart(); - } else { - d3.select(idVal) - .attr("r", resourceRadius) - .style("fill", "#311B92"); - expandedNodesArray.pop(idVal); - } - } + + } + else if (expandedNodesArray.includes(idVal)) + { + removeClikedNode = ""; + onDoubleClickedNewlyCreatedLinks.forEach(function(val) + { + if (val.nodeClicked === idVal) { + for(var i=0;i Date: Fri, 1 Nov 2019 22:39:11 +0100 Subject: [PATCH 40/66] 1. change color of node on expanding/collapsing it. 2. fix old issue of on hover not displaying source and object values correctly. --- .../d3v4-rdf-ontology-graph-view.js | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js index d8886eeef..287bc6cd6 100644 --- a/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js +++ b/ida-chatbot/src/assets/rdfontology/d3v4-rdf-ontology-graph-view.js @@ -772,10 +772,12 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa .text(function(d) { var labelStr = d.predicate; var returnValue; + if (labelStr.includes("subClassOf")) { - returnValue = "Source : " + d.source + "\nProperty : " + customizeGraphArray.subClassLabel + "\nObject : " + d.target; + + returnValue = "Source : " + d.source.id+ "\nProperty : " + customizeGraphArray.subClassLabel + "\nObject : " + d.target.id; } else { - returnValue = "Source : " + d.source + "\nProperty : " + d.predicate + "\nObject : " + d.target; + returnValue = "Source : " + d.source.id + "\nProperty : " + labelStr + "\nObject : " + d.target.id; } return returnValue; @@ -802,7 +804,25 @@ function createV4RDFOntologyGraph(figId, svgId, fileName, displayDeustch, displa }) .style("fill", function(d) { var labelStr = d.id; - if (d.isLitteral) { + var expandedNode = false; + + if(!dispalyAllprop) + { + expandedNodesArray.forEach(function(val) + { + if(val === "#"+d.nodeId) + { + expandedNode = true; + } + }); + } + + if(expandedNode) + { + return "#8E44AD"; + } + if (d.isLitteral) + { return customizeGraphArray.literalNodeColor; } return customizeGraphArray.resourceNodeColor; From f84a7a30b7634cc06a32bf81f48c6f3733e11ea6 Mon Sep 17 00:00:00 2001 From: RahulSherikar Date: Sat, 2 Nov 2019 13:39:10 +0100 Subject: [PATCH 41/66] 1.Angular material changes in rdf-ontology components. --- .../rdf-ontology-view.component.css | 19 +- .../rdf-ontology-view.component.html | 231 ++++-------------- .../rdf-ontology-view.component.ts | 1 + 3 files changed, 69 insertions(+), 182 deletions(-) diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css index b63415fd7..724aaf8cb 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.css @@ -1,10 +1,17 @@ -.labelClass { - +.rightSideContainer{ + width: 30%; +} +.mat-toolbar.mat-primary { + background: #f7f7f8; + color: #0b0b0b; +} +.labelClass { padding-left: 20px; text-indent: -15px; padding-top: 7px; font-size: 19px; - } + padding-right: 5px; +} .checkboxClass { width: 20px; height: 20px; @@ -15,6 +22,9 @@ top: -8px; *overflow: hidden; } + + + .inputLabelClass { padding-left: 10px; font-size: 15px; @@ -35,4 +45,5 @@ padding-left: 35px; font-size: 18px; width:275px; - } \ No newline at end of file + } + diff --git a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html index 7bcbdcfcf..1bee13ee4 100644 --- a/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html +++ b/ida-chatbot/src/app/components/rdf-ontology-view/rdf-ontology-view.component.html @@ -1,191 +1,66 @@ -
+ + + +
+

Historian Ontology Graph

+
+
-
-

Historian Ontology Graph

-
-
-