Language
Login
Language Setting
X
English
日本語 [Japanese]
about this App
プロパティ抽出器(multi_property_filter)
useful
2
Loading...
window.onload = function() { var keyword = getParameterFromURL("subject"); // obtain keyword from the URL "?subject=" var list = ""; // list to be displayed var prop_list0 = new Array(); $.each(LinkData.getWorks(), function(workKey, workValue) { $.each(LinkData.getFiles(workValue), function(fileKey, fileValue) { var hit = ""; // list of subjects whose URI matches keyword var nHit = 0; // number of subjects whose URI matches keyword $.each(LinkData.getSubjects(workValue, fileValue), function(subjKey, subjValue) { var s = ""; // subject to be displayed //var prop0 = LinkData.getTriplesBySubject(workValue, fileValue, subjValue); $.each( LinkData.getTriplesBySubject(workValue, fileValue, subjValue), function( tripleKey, tripleValue ) { var prop = tripleValue.property; prop_list0.push(getLastName(prop)); }); }); }); }); var b = prop_list0.filter(function (x, i, self) { return self.indexOf(x) === i; }); //document.write(prop_list0); document.write(b); //document.write(prop0); window.find(highlight); }; // Get a parameter value in URL (e.g. ?paramString=value ) function getParameterFromURL( paramString ) { var value = ""; var topWindow = top.window.location.search; if( topWindow ){ var q = decodeURIComponent(topWindow.substring(1,topWindow.length)).split("&"); for ( var i = 0; i < q.length; i++ ){ var r = q[i].split("="); if ( r[0] == paramString ) value = r[1]; } } return value; } // Highlight keyword in the string function highlight( string, keyword ) { if ( keyword.length > 0 ) { var ss = string.split(keyword); var len = ss.length; if ( len > 1 ) { string = ss[0]; for ( i = 1; i < len; i++ ) // string += "<font color=\"red\">"+keyword+"</font>"+ss[i]; string += "<span class=\"highlight\">"+keyword+"</span>"+ss[i]; } } return string; } // get the last name of the string separated with # and / function getLastName( string ) { string = decodeURIComponent(string); var sharp = string.split("#"); var slash = sharp[sharp.length-1].split("/"); var lastName = slash[slash.length-1]; return lastName; } // return a link to Google map search function addLinkToMap( latitude, longitude ) { var s = "<br><a target=\"_blank\" href=\"http://www.google.com/maps/?q=" + latitude + "," + longitude + "\">Show map</a>"; return s; } // shortening URL e.g. http://.../123.jpg function shortenURL( url ) { url = decodeURIComponent(url); var slash = url.split("/"); var lastName = slash[slash.length-1]; return url.split(":")[0]+"://.../"+lastName; }
span.highlight {color: red;} span.propertyName {color: gray;} span.subject { color: blue; } span.object{ color: black; } body { background: white; } a, a span { text-decoration: underline; } a:hover, a span:hover { text-decoration: none; }
<div id="result"></div>
Preview
Input Data
ReadMe
Snapshots
This application does not using any data or contains private/limited data.
Link http://app.linkdata.org/run/app1s1074i?tab=readme
jquery-1.11.2.min.js
Work
Add
Clear
insert work id or work name.