document.Yowl.register( "foaf", [ "Found a person", "Loading external file" ], [ "Found a person", "Loading external file" ], "http://www.foaf-project.org/images/foafTiny.gif" ); /* * Find all 'external' FOAF people. By setting an 'imp' object we get the store object to * load it and add all of the triples. */ var results = document.meta.query2({ select: [ "imp" ], where: [ { pattern: [ "?person", "a", "http://xmlns.com/foaf/0.1/Person" ] }, { pattern: [ "?person", "http://xmlns.com/foaf/0.1/knows", "?imp" ] } ] }); /* * Apply the action to each of the results. The presence of 'imp' causes the external file * to be loaded. */ document.meta.walk2(results, { });
foaf-person document.Yowl.notify( "Found a person", "Found a person", "Testing the classFormatDomain", "foaf", null, true, 0 ); select: [ "person" ], where: [ { pattern: [ "?person", "a", "http://xmlns.com/foaf/0.1/Person" ], setUserData: true } ] foaf-person select: [ "org" ], where: [ { pattern: [ "?org", "a", "http://xmlns.com/foaf/0.1/Organization" ], setUserData: true } ] foaf-org select: [ "name", "mbox", "depiction", "company", "street", "locality", "zip" ], where: [ { pattern: [ "?slot", "a", "http://argot-hub.googlecode.com/meta" ], setUserData: true }, { pattern: [ "?person", "a", "http://xmlns.com/foaf/0.1/Person" ] }, { pattern: [ "?person", "http://xmlns.com/foaf/0.1/name", "?name" ] }, /* * Add any additional properties that we need. */ { pattern: [ "?person", "http://xmlns.com/foaf/0.1/mbox", "?mbox" ], optional: true }, { pattern: [ "?person", "http://xmlns.com/foaf/0.1/img", "?depiction" ], optional: true }, { where: [ { pattern: [ "?person", "http://xmlns.com/foaf/0.1/workplaceHomepage", "?wphp" ] }, { pattern: [ "?org", "http://xmlns.com/foaf/0.1/homepage", "?wphp" ] }, { pattern: [ "?org", "http://xmlns.com/foaf/0.1/name", "?company" ], optional: true }, { pattern: [ "?org", "http://www.w3.org/2006/vcard/ns#street-address", "?street" ], optional: true }, { pattern: [ "?org", "http://www.w3.org/2006/vcard/ns#locality", "?locality" ], optional: true }, { pattern: [ "?org", "http://www.w3.org/2006/vcard/ns#postal-code", "?zip" ], optional: true } ], optional: true } ] document.Yowl.notify( "Found a person", ${name.content}, ${company.content} + ", " + ${locality.content}, "foaf", ${depiction}, true, 0 );
${name} ${company}
select: [ "s" ], where: [ { pattern: [ "?s", "a", "http://xmlns.com/foaf/0.1/Person" ], setUserData: true }, { pattern: [ "?s", "http://xmlns.com/foaf/0.1/knows", "?friend" ] } ] foaf-knows foaf-depiction foaf-name foaf-name