{"id":2362,"date":"2004-05-21T13:45:14","date_gmt":"2004-05-21T13:45:14","guid":{"rendered":"http:\/\/www.leobard.net\/blog\/?p=2362"},"modified":"2017-11-04T15:52:50","modified_gmt":"2017-11-04T15:52:50","slug":"mozilla-rdf-javascript-support","status":"publish","type":"post","link":"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/","title":{"rendered":"Mozilla RDF Javascript support"},"content":{"rendered":"<p>Part II of the series<a href=\"http:\/\/leobard.twoday.net\/stories\/222794\/\">diving into Mozilla<\/a>.<\/p>\n<h2>Simple XUL example<\/h2>\n<p>To get going with RDF in Mozilla, it is good to make a Hello World-kind of Application. I did this by the way of &#8220;jslib&#8221;, a javascript library that helps Mozilla developers.<\/p>\n<p>Step1 &#8211; Download and Install <a href=\"http:\/\/jslib.mozdev.org\/index.html\">jslib<\/a><br \/>\nfrom <a href=\"http:\/\/jslib.mozdev.org\/downloads\/index.html\">http:\/\/jslib.mozdev.org\/downloads\/index.html<\/a><br \/>\nand install it in your mozilla (it is a XPI, so no problem there)<br \/>\nTest the library by opening this url: <a href=\"chrome:\/\/jslib\/content\/\">chrome:\/\/jslib\/content\/<\/a> <br \/>\nsee also <a href=\"http:\/\/jslib.mozdev.org\/installation.html\">installation doc<\/a>.<\/p>\n<p>Step2 &#8211; write a XUL file to test<br \/>\nI did it with this ugly file that extracts the firstname from my public FOAF file: <a href=\"http:\/\/leobard.twoday.net\/files\/rdflib_hello\/\" title=\"Mozilla XUL example. Hello Leo.\">rdflib_hello<\/a> (xul, 1 KB).<\/p>\n<p>Step3 &#8211; configure it to run<br \/>\nThe problem is that the XUL file must be placed where XUL files are usually placed. If you know how to do this, fine. If you don&#8217;t, you have to configure jslib so that it accepts files outside the chrome. This may be a security risk. <a href=\"http:\/\/jslib.mozdev.org\/docs.html#local\">Description to use jslib from local XUL files<\/a>.<\/p>\n<p>Step4 &#8211; run rdflib_hello.xul<br \/>\nStart Mozilla, go to &#8220;open file&#8221; and open the XUL file (or use chrome:\/\/ if you managed to put it in your chrome).<br \/>\nYou should see a single button. Press it and the String &#8220;Leo&#8221; should come.<\/p>\n<p>What it does:<br \/>\nIt loads my foaf file from my public homepage and extracts a literal property from a resource. To do this, there are fine XPCOM objects in Mozilla. But the XPCOM are hard to use, so the jslib guys made this system of Javascript helper objects to handle RDF. The script loads these jslib functions. Then, in the function testresult(), it uses an RDF object to get the RDF data from the homepage, select a resource from it and query an attribute of the resource.<\/p>\n<p>You can also use the XPCOM RDF objects directly. So, at first glance Mozilla proves to be RDF-capable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part II of the seriesdiving into Mozilla. Simple XUL example To get going with RDF in Mozilla, it is good to make a Hello World-kind of Application. I did this by the way of &#8220;jslib&#8221;, a javascript library that helps Mozilla developers. Step1 &#8211; Download and Install jslib from http:\/\/jslib.mozdev.org\/downloads\/index.html and install it in your &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mozilla RDF Javascript support&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bluesky_dont_syndicate":"","_bluesky_syndication_accounts":"","_bluesky_syndication_text":"","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-2362","post","type-post","status-publish","format-standard","hentry","category-semweb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Mozilla RDF Javascript support - Leobard&#039;s blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mozilla RDF Javascript support - Leobard&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"Part II of the seriesdiving into Mozilla. Simple XUL example To get going with RDF in Mozilla, it is good to make a Hello World-kind of Application. I did this by the way of &#8220;jslib&#8221;, a javascript library that helps Mozilla developers. Step1 &#8211; Download and Install jslib from http:\/\/jslib.mozdev.org\/downloads\/index.html and install it in your &hellip; Continue reading &quot;Mozilla RDF Javascript support&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/\" \/>\n<meta property=\"og:site_name\" content=\"Leobard&#039;s blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/leobard\" \/>\n<meta property=\"article:published_time\" content=\"2004-05-21T13:45:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-11-04T15:52:50+00:00\" \/>\n<meta name=\"author\" content=\"leobard\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"leobard\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2004\\\/05\\\/21\\\/mozilla-rdf-javascript-support\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2004\\\/05\\\/21\\\/mozilla-rdf-javascript-support\\\/\"},\"author\":{\"name\":\"leobard\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/#\\\/schema\\\/person\\\/23f718c5d3bd8d343befaa1b11bdc609\"},\"headline\":\"Mozilla RDF Javascript support\",\"datePublished\":\"2004-05-21T13:45:14+00:00\",\"dateModified\":\"2017-11-04T15:52:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2004\\\/05\\\/21\\\/mozilla-rdf-javascript-support\\\/\"},\"wordCount\":325,\"commentCount\":0,\"articleSection\":[\"SemWeb\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2004\\\/05\\\/21\\\/mozilla-rdf-javascript-support\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2004\\\/05\\\/21\\\/mozilla-rdf-javascript-support\\\/\",\"url\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2004\\\/05\\\/21\\\/mozilla-rdf-javascript-support\\\/\",\"name\":\"Mozilla RDF Javascript support - Leobard&#039;s blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/#website\"},\"datePublished\":\"2004-05-21T13:45:14+00:00\",\"dateModified\":\"2017-11-04T15:52:50+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/#\\\/schema\\\/person\\\/23f718c5d3bd8d343befaa1b11bdc609\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2004\\\/05\\\/21\\\/mozilla-rdf-javascript-support\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2004\\\/05\\\/21\\\/mozilla-rdf-javascript-support\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/2004\\\/05\\\/21\\\/mozilla-rdf-javascript-support\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mozilla RDF Javascript support\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/\",\"name\":\"Leobard&#039;s blog\",\"description\":\"personal weblog of Leo Sauermann\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/#\\\/schema\\\/person\\\/23f718c5d3bd8d343befaa1b11bdc609\",\"name\":\"leobard\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g\",\"caption\":\"leobard\"},\"description\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/about-leo-sauermann\\\/\",\"sameAs\":[\"https:\\\/\\\/www.leobard.net\\\/\",\"https:\\\/\\\/www.facebook.com\\\/leobard\",\"https:\\\/\\\/www.instagram.com\\\/leobarder\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/leosauermann\\\/\"],\"url\":\"https:\\\/\\\/www.leobard.net\\\/blog\\\/author\\\/leobard\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mozilla RDF Javascript support - Leobard&#039;s blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/","og_locale":"en_US","og_type":"article","og_title":"Mozilla RDF Javascript support - Leobard&#039;s blog","og_description":"Part II of the seriesdiving into Mozilla. Simple XUL example To get going with RDF in Mozilla, it is good to make a Hello World-kind of Application. I did this by the way of &#8220;jslib&#8221;, a javascript library that helps Mozilla developers. Step1 &#8211; Download and Install jslib from http:\/\/jslib.mozdev.org\/downloads\/index.html and install it in your &hellip; Continue reading \"Mozilla RDF Javascript support\"","og_url":"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/","og_site_name":"Leobard&#039;s blog","article_author":"https:\/\/www.facebook.com\/leobard","article_published_time":"2004-05-21T13:45:14+00:00","article_modified_time":"2017-11-04T15:52:50+00:00","author":"leobard","twitter_card":"summary_large_image","twitter_misc":{"Written by":"leobard","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/#article","isPartOf":{"@id":"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/"},"author":{"name":"leobard","@id":"https:\/\/www.leobard.net\/blog\/#\/schema\/person\/23f718c5d3bd8d343befaa1b11bdc609"},"headline":"Mozilla RDF Javascript support","datePublished":"2004-05-21T13:45:14+00:00","dateModified":"2017-11-04T15:52:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/"},"wordCount":325,"commentCount":0,"articleSection":["SemWeb"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/","url":"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/","name":"Mozilla RDF Javascript support - Leobard&#039;s blog","isPartOf":{"@id":"https:\/\/www.leobard.net\/blog\/#website"},"datePublished":"2004-05-21T13:45:14+00:00","dateModified":"2017-11-04T15:52:50+00:00","author":{"@id":"https:\/\/www.leobard.net\/blog\/#\/schema\/person\/23f718c5d3bd8d343befaa1b11bdc609"},"breadcrumb":{"@id":"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.leobard.net\/blog\/2004\/05\/21\/mozilla-rdf-javascript-support\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.leobard.net\/blog\/"},{"@type":"ListItem","position":2,"name":"Mozilla RDF Javascript support"}]},{"@type":"WebSite","@id":"https:\/\/www.leobard.net\/blog\/#website","url":"https:\/\/www.leobard.net\/blog\/","name":"Leobard&#039;s blog","description":"personal weblog of Leo Sauermann","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.leobard.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.leobard.net\/blog\/#\/schema\/person\/23f718c5d3bd8d343befaa1b11bdc609","name":"leobard","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4f15ee76fffcb732371d121c4713809a3f075186c6223630d4fe6c82ae88166d?s=96&d=mm&r=g","caption":"leobard"},"description":"https:\/\/www.leobard.net\/blog\/about-leo-sauermann\/","sameAs":["https:\/\/www.leobard.net\/","https:\/\/www.facebook.com\/leobard","https:\/\/www.instagram.com\/leobarder\/","https:\/\/www.linkedin.com\/in\/leosauermann\/"],"url":"https:\/\/www.leobard.net\/blog\/author\/leobard\/"}]}},"_links":{"self":[{"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/posts\/2362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/comments?post=2362"}],"version-history":[{"count":1,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/posts\/2362\/revisions"}],"predecessor-version":[{"id":3148,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/posts\/2362\/revisions\/3148"}],"wp:attachment":[{"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/media?parent=2362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/categories?post=2362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.leobard.net\/blog\/wp-json\/wp\/v2\/tags?post=2362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}