/*** /* launch_foaf_explorer 0.3 by Charles Nepote (2007-06-14) Licence GPL v. 2. launch_foaf_explorer is a script for the Firefox Extension Operator 0.8a (see http://www.kaply.com/weblog/2007/06/04/operator-08a-is-available/ ) It launch the Foaf file of a given resource on 2 conditions : -- the resource is a foaf:Person -- the resource is defined by an external URI with the rdfs:isDefinedBy property */ var foaf_explorer = { /* description : will be shown as an action for a given subject */ description: "Show with Foaf Explorer", /* icon : ? */ /* icon: "http://xml.mfd-consult.dk/images/foaf-explorer.32.png", */ scope: { semantic: { "RDFa" : { /* property which is concerned by this action */ property : "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", defaultNS : "http://www.w3.org/1999/02/22-rdf-syntax-ns#", } } }, doAction: function(semanticObject, semanticObjectType) { if (semanticObjectType == "RDFa") { var so = semanticObject; var isDefinedBy = so.model.getProperty(so.subject, "http://www.w3.org/2000/01/rdf-schema#isDefinedBy"); /* If the object is a foaf:Person and is defined by an external URI (rdfs:isDefinedBy) */ /* then launch the foaf file with foaf explorer */ if (so.type == "http://xmlns.com/foaf/0.1/Person" && isDefinedBy) { /* alert (so.type); /* debug */ return "http://xml.mfd-consult.dk/foaf/explorer/?foaf=" + isDefinedBy; } } } }; SemanticActions.add("foaf_explorer", foaf_explorer);