Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
** and allows the user to edit their own profile.
**
** Usage: paneRegistry.register('profile/profilePane')
** or standalone script adding onto existing mashlib.
*/
exports.__esModule = true
// import UI from 'solid-ui'
// import solidUi, { SolidUi } from 'solid-ui'
// @@ TODO: Write away the need for exception on next line
// eslint-disable-next-line camelcase
var solid_UI_1 = require('solid-UI')
var UI2 = require('solid-UI')
// let panes: any
// let UI
var UI0 = require('solid-ui')
console.log('UI0.rdf ' + UI0.rdf)
console.log('UI1.rdf ' + solid_UI_1.default.rdf)
console.log('UI2.rdf ' + UI2.rdf)
var thisPane = { foo: 'bar' }
exports.default = thisPane
// ENDS
statementsAsTables: function statementsAsTables (sts, context, initialRoots) {
var myDocument = context.dom
// var outliner = context.getOutliner(myDocument)
var rep = myDocument.createElement('table')
var sz = UI.rdf.Serializer(context.session.store)
var res = sz.rootSubjects(sts)
var roots = res.roots
var subjects = res.subjects
var loopBreakers = res.loopBreakers
for (var x in loopBreakers) {
console.log('\tdataContentPane: loopbreaker:' + x)
}
var doneBnodes = {} // For preventing looping
var referencedBnodes = {} // Bnodes which need to be named alas
// The property tree for a single subject or anonymous node
function propertyTree (subject) {
// print('Proprty tree for '+subject)
var rep = myDocument.createElement('table')
var lastPred = null
var sts = subjects[sz.toStr(subject)] // relevant statements
* TAMI (Transparent and Accountabe Data Mining) project
* This pane will display the justification trace of a when it encounters
* air reasoner output
* oshani@csail.mit.edu
*
* AIR is a rule language used in the TAMI project. The AIR reasoner
* outputs a proof of its results. This pane displays the proof as a
* human-redable justification of the result.
*/
var UI = require('solid-ui')
// moved to airpane.js from paneutils.js 2014 tbl
var ap_air = UI.rdf.Namespace("http://dig.csail.mit.edu/TAMI/2007/amord/air#");
var ap_tms = UI.rdf.Namespace("http://dig.csail.mit.edu/TAMI/2007/amord/tms#");
var ap_compliant = ap_air('compliant-with');
var ap_nonCompliant = ap_air('non-compliant-with');
var ap_antcExpr = ap_tms('antecedent-expr');
var ap_just = ap_tms('justification');
var ap_subExpr = ap_tms('sub-expr');
var ap_description = ap_tms('description');
var ap_ruleName = ap_tms('rule-name');
var ap_prem = ap_tms('premise');
var ap_instanceOf = ap_air('instanceOf');
var justificationsArr = [];
var airPane = module.exports = {};
function addMenuItem (predicate) {
if (table.firstChild && table.firstChild.className === 'no-suggest') {
table.removeChild(table.firstChild)
}
var Label = UI.utils.predicateLabelForXML(predicate, false)
// Label = Label.slice(0,1).toUpperCase() + Label.slice(1);
if (!predicate.uri) return // bnode
var theNamespace = '??'
for (var name in NameSpaces) {
UI.log.debug(NameSpaces[name])
if (UI.rdf.Util.string_startswith(predicate.uri, NameSpaces[name])) {
theNamespace = name
break
}
}
var tr = table.appendChild(myDocument.createElement('tr'))
tr.setAttribute('about', predicate)
var th = tr.appendChild(myDocument.createElement('th'))
th.appendChild(myDocument.createElement('div')).appendChild(
myDocument.createTextNode(Label)
)
tr.appendChild(myDocument.createElement('td')).appendChild(
myDocument.createTextNode(theNamespace.toUpperCase())
)
}
function addPredicateChoice (selectedQuery) {
plist = kb.statementsMatching(undefined, undefined, subject)
outliner.appendPropertyTRs(div, plist, true, filter)
if (
subject.termType === 'Literal' &&
subject.value.slice(0, 7) === 'http://'
) {
outliner.appendPropertyTRs(
div,
[$rdf.st(kb.sym(subject.value), UI.ns.link('uri'), subject)],
true,
filter
)
}
if (
(subject.termType === 'NamedNode' &&
kb.updater.editable(UI.rdf.Util.uri.docpart(subject.uri), kb)) ||
(subject.termType === 'BlankNode' &&
kb.anyStatementMatching(subject) &&
kb.anyStatementMatching(subject).why &&
kb.anyStatementMatching(subject).why.uri &&
kb.updater.editable(kb.anyStatementMatching(subject).why.uri))
// check the document containing something about of the bnode @@ what about as object?
/* ! && HCIoptions["bottom insert highlights"].enabled */
) {
var holdingTr = dom.createElement('tr') // these are to minimize required changes
var holdingTd = dom.createElement('td') // in userinput.js
holdingTd.setAttribute('colspan', '2')
holdingTd.setAttribute('notSelectable', 'true')
var img = dom.createElement('img')
img.src = UI.icons.originalIconBase + 'tango/22-list-add-new.png'
img.addEventListener('click', function addNewTripleIconMouseDownListener (
e
// Tag Pane
//
// Pane for adding semantics to the sort of tags you tag a photo with.
//
// Written by: albert08, 2009
//
var UI = require('solid-ui')
var tagPane = module.exports = {};
tagPane.icon = UI.icons.originalIconBase + 'tag_small.png';
tagPane.name = 'Tag';
// namespace
var RDF = UI.rdf.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
var RDFS = UI.rdf.Namespace("http://www.w3.org/2000/01/rdf-schema#");
var TAGS = UI.rdf.Namespace("http://www.holygoat.co.uk/owl/redwood/0.1/tags/");
var PAC = UI.rdf.Namespace("http://dig.csail.mit.edu/2008/PAC/ontology/pac#");
var OWL = UI.rdf.Namespace("http://www.w3.org/2002/07/owl#");
tagPane.label = function(subject) {
if (!UI.store.whether(subject, RDF('type'), TAGS("Tag"))) {
return null;
}
return "Tag";
}
tagPane.render = function(subject, myDocument) {
var kb = UI.store
var theTime = arrDateTime[1].replace("Z","").split(":");
this.setUTCDate(1);
this.setUTCFullYear(theDate[0]);
this.setUTCMonth(theDate[1]);
this.setUTCDate(theDate[2]);
this.setUTCHours(theTime[0]);
this.setUTCMinutes(theTime[1]);
this.setUTCSeconds(theTime[2]);
return this;
};
//NAMESPACES
var foaf = UI.rdf.Namespace("http://xmlns.com/foaf/0.1/");
var cloud = UI.rdf.Namespace("http://www.w3.org/ns/cloud#");
var sioc = UI.rdf.Namespace("http://rdfs.org/sioc/ns#");
var sioct = UI.rdf.Namespace('http://rdfs.org/sioc/types#');
var rdf= UI.ns.rdf;
var dc = UI.rdf.Namespace('http://purl.org/dc/elements/1.1/');
var dcterms = UI.rdf.Namespace('http://purl.org/dc/terms/');
var rss = UI.rdf.Namespace("http://purl.org/rss/1.0/");
var kb = UI.store;
var sf = UI.store.fetcher;
var sparqlUpdater = UI.store.updater;
var Events = new CustomEvents();
sf.lookUpThing(kb.sym('http://foaf.qdos.com/reverse/?path=' + encodeURIComponent(s.uri)));
var workspace =kb.statementsMatching(null,cloud('contains'),s);
workspace = (workspace.length > 0 )? workspace[0].subject.uri:false;
render: function(subject, myDocument) { //Subject is source of doc, document is HTML doc element we are attaching elements to
var outliner = UI.panes.getOutliner(myDocument)
//NAMESPACES ------------------------------------------------------
var foaf = UI.rdf.Namespace("http://xmlns.com/foaf/0.1/");
//var rdf= UI.ns.rdf;
var rdf = UI.rdf.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
var owl = UI.rdf.Namespace("http://www.w3.org/2002/07/owl/");
var bibo = UI.rdf.Namespace("http://purl.org/ontology/bibo/");
var dcterms = UI.rdf.Namespace('http://purl.org/dc/terms/');
var dcelems = UI.rdf.Namespace('http://purl.org/dc/elements/1.1/');
var soics = UI.rdf.Namespace('http://rdfs.org/sioc/spec/');
var kb = UI.store;
var sparqlUpdater = UI.store.updater;
var collections_URI = 'http://dig.csail.mit.edu/2007/wiki/docs/collections';
var journalURI = "";
var works_URI = 'http://dig.csail.mit.edu/2007/wiki/docs/works'
var jarticleURI = "";
evt["target"].addEventListener('click',LawPane.render.show, false);
var id = evt["target"].id.toString().substring(4); //images have ids 'img_n' where 'n' is the id we are seeking
myDocument.getElementById("td_"+id).setAttribute('style','display:none');
}
var div = myDocument.createElement("div");
div.setAttribute('class', 'instancePane')
div.setAttribute('style', ' border-top: solid 1px #777; border-bottom: solid 1px #777; margin-top: 0.5em; margin-bottom: 0.5em ')
//Extract the log and policy files
var uris = extractFileURIs(myDocument.location.toString());
var policy = uris.pop();
var log = uris.pop();
//Retrieve policy file to get the description of the policy
var xmlhttp = UI.rdf.Util.XMLHTTPFactory();
xmlhttp.onreadystatechange=state_Change;
xmlhttp.open("GET",policy,true);
xmlhttp.send(null);
function state_Change(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
var policy_text = xmlhttp.responseText.toString();
var start_index = policy_text.search("rdfs:comment");
var end_index = 0;
if (start_index > -1){
var newStr = policy_text;
end_index = newStr.slice(start_index).search(/";/); //"
}
var rule_statement = policy_text.substring(start_index+"rdfs:comment".length+2, start_index+end_index);
if (myDocument.getElementById('td_2') != null)
myDocument.getElementById('td_2').innerHTML = rule_statement;
}
function alternativeRendering () {
var sz = UI.rdf.Serializer(context.session.store)
var res = sz.rootSubjects(sts)
var roots = res.roots
var p = {}
p.render = function (s2) {
var div = myDocument.createElement('div')
div.setAttribute('class', 'withinDocumentPane')
var plist = kb.statementsMatching(s2, undefined, undefined, subject)
outliner.appendPropertyTRs(div, plist, false, function (
_pred,
_inverse
) {
return true
})
return div
}
for (var i = 0; i < roots.length; i++) {