Skip to content

Commit ef5dff6

Browse files
added bugfix for woqltable and added new query to woql js
1 parent 769fcb1 commit ef5dff6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/viewer/woqlTable.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const WOQLTableConfig = require("./tableConfig");
22
const UTILS = require('../utils');
33
const WOQLRule = require('../woqlRule');
4+
const WOQLResult = require('../woqlResult');
45

56
function WOQLTable(client, config){
67
this.client = client;

lib/woql.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -931,10 +931,11 @@ WOQLQuery.prototype.documentProperties = function(id){
931931
WOQLQuery.prototype.getDocumentConnections = function(id){
932932
return this.and(
933933
WOQL.or(
934-
WOQL.triple(id, "v:Outgoing", "v:Entid"),
935-
WOQL.triple("v:Entid", "v:Incoming", id)
934+
WOQL.triple("v:Docid", "v:Outgoing", "v:Entid"),
935+
WOQL.triple("v:Entid", "v:Incoming", "v:Docid")
936936
),
937-
WOQL.isa("v:Entid", "v:Enttype"),
937+
WOQL.eq("v:Docid", id),
938+
WOQL.triple("v:Entid", "type", "v:Enttype"),
938939
WOQL.sub("v:Enttype", "tcs:Document"),
939940
WOQL.opt().triple("v:Entid", "rdfs:label", "v:Label"),
940941
WOQL.opt().quad("v:Enttype", "rdfs:label", "v:Class_Label", "db:schema")
@@ -945,6 +946,7 @@ WOQLQuery.prototype.getAllDocumentConnections = function(){
945946
return this.and(
946947
WOQL.triple("v:doc1", "type", "v:Enttype"),
947948
WOQL.triple("v:doc2", "type", "v:Enttype2"),
949+
WOQL.not().eq("v:doc1", "v:doc2"),
948950
WOQL.sub("v:Enttype", "tcs:Document"),
949951
WOQL.sub("v:Enttype2", "tcs:Document"),
950952
WOQL.triple("v:doc1", "v:Predicate", "v:doc2"),

0 commit comments

Comments
 (0)