|
From: <to...@us...> - 2008-01-17 20:27:50
|
Revision: 101
http://xoperator.svn.sourceforge.net/xoperator/?rev=101&view=rev
Author: tomatop
Date: 2008-01-17 12:27:52 -0800 (Thu, 17 Jan 2008)
Log Message:
-----------
Removed Paths:
-------------
trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafGroupAttributes.groovy
trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafGroupMember.groovy
trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafPersonAttributes.groovy
trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/iCalWhereNow.groovy
trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/sample.groovy
trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/tellMeMoreAbout.groovy
Deleted: trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafGroupAttributes.groovy
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafGroupAttributes.groovy 2008-01-17 11:51:28 UTC (rev 100)
+++ trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafGroupAttributes.groovy 2008-01-17 20:27:52 UTC (rev 101)
@@ -1,58 +0,0 @@
-/////////////////////////////////////////////
-/// Implementation of the simple template "Tell me * of *"
-/////////////////////////////////////////////
-sparqlresult=""
-//context.sendMessageToUser("ok, I'll try find out this.")
-
-// fetching the log
-log = context.getLog()
-
-// the wildcards
-wildcard1 = match.wildcard(bitoflife.chatterbean.Match.Section.PATTERN,1).trim();
-wildcard2 = match.wildcard(bitoflife.chatterbean.Match.Section.PATTERN,2).trim();
-
-//FROM = "http://demo.ontowiki.net/model/export/?m=http%3A%2F%2Fbis.ontowiki.net%2F&output=xml"
-//FROM = "http://sebastian.dietzold.de/rdf/foaf.rdf"
-FromPart = "FROM <http://xmlns.com/foaf/spec/index.rdf> "
-
-// where can we find infos about the subject
-documentQuery = "SELECT DISTINCT ?document "+
- FromPart+
- "WHERE{?s ?p1 ?subjectpattern. ?s <http://www.w3.org/2000/01/rdf-schema#seeAlso> ?document."+
- "FILTER regex(?subjectpattern, '.*"+wildcard2+".*', 'i').}"
-log.info(documentQuery)
-//context.sendMessageToUser(documentQuery)
-
-documents = context.queryForTable(documentQuery,null,null)
-FromNamedPart = ""
-documents.each(){
- res = it
- log.info(res.getResultCount())
- // res.getResultRows returns a List of Maps. Each map represents a row, with the headline as key.
- res.getResultRows().each(){
- //log.info("Hohoho: ${it["ypsilon"]} is a ${it["x"]}")
- FromNamedPart += "FROM <${it["document"]}> \n"
- log.info(it["document"])
- }
-}
-
-valueQuery = "SELECT DISTINCT ?value "+
- FromPart+
- FromNamedPart+
- "WHERE {?s ?p1 ?subjectpattern. ?s ?p2 ?value. ?p2 ?property ?propertypattern. FILTER regex(?subjectpattern, '.*"+wildcard2+".*', 'i'). FILTER regex(?propertypattern, '.*"+wildcard1+".*', 'i')}"
-log.info(valueQuery)
-//context.sendMessageToUser(valueQuery)
-
-counter = 0;
-values = context.queryForTable(valueQuery,null,null)
-values.each(){
- res = it
- counter = counter + res.getResultCount()
- log.info(res.getResultCount())
- res.getResultRows().each(){
- log.info(it["value"])
- context.sendMessageToUser(it["value"])
- }
-}
-if(counter == 0) context.sendMessageToUser("Sorry, I can't answer your question.")
-
Deleted: trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafGroupMember.groovy
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafGroupMember.groovy 2008-01-17 11:51:28 UTC (rev 100)
+++ trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafGroupMember.groovy 2008-01-17 20:27:52 UTC (rev 101)
@@ -1,36 +0,0 @@
-/////////////////////////////////////////////
-/// Who is member of *
-/////////////////////////////////////////////
-sparqlresult=""
-//context.sendMessageToUser("ok, I'll try find out this.")
-
-//now = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(new Date())
-//context.sendMessageToUser(now)
-
-// fetching the log
-log = context.getLog()
-
-// the wildcards
-wildcard1 = match.wildcard(bitoflife.chatterbean.Match.Section.PATTERN,1).trim();
-
-// query for member names
-memberQuery = "SELECT DISTINCT ?name FROM <http://xmlns.com/foaf/spec/index.rdf> WHERE {"+
- "?s ?p1 ?subjectpattern. ?s <http://xmlns.com/foaf/0.1/member> ?person. ?person <http://xmlns.com/foaf/0.1/name> ?name."+
- "FILTER regex(?subjectpattern, '.*"+wildcard1+".*', 'i').}"
-log.info(memberQuery)
-//context.sendMessageToUser(documentQuery)
-
-counter = 0;
-members = context.queryForTable(memberQuery,null,null)
-members.each(){
- res = it
- counter = counter + res.getResultCount()
- if (res.getResultCount() > 0) context.sendMessageToUser("From " + res.getStoreName() + ":")
- log.info(res.getResultCount())
- res.getResultRows().each(){
- log.info(it["name"])
- context.sendMessageToUser(" * "+it["name"])
- }
-}
-if(counter == 0) context.sendMessageToUser("Sorry, I can't answer your question.")
-
Deleted: trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafPersonAttributes.groovy
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafPersonAttributes.groovy 2008-01-17 11:51:28 UTC (rev 100)
+++ trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/foafPersonAttributes.groovy 2008-01-17 20:27:52 UTC (rev 101)
@@ -1,60 +0,0 @@
-/////////////////////////////////////////////
-/// Implementation of the simple template "Tell me * of *"
-/////////////////////////////////////////////
-sparqlresult=""
-//context.sendMessageToUser("ok, I'll try find out this.")
-
-//now = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(new Date())
-//context.sendMessageToUser(now)
-
-// fetching the log
-log = context.getLog()
-
-// the wildcards
-wildcard1 = match.wildcard(bitoflife.chatterbean.Match.Section.PATTERN,1).trim();
-wildcard2 = match.wildcard(bitoflife.chatterbean.Match.Section.PATTERN,2).trim();
-
-//FROM = "http://demo.ontowiki.net/model/export/?m=http%3A%2F%2Fbis.ontowiki.net%2F&output=xml"
-//FROM = "http://sebastian.dietzold.de/rdf/foaf.rdf"
-FromPart = "FROM <http://xmlns.com/foaf/spec/index.rdf> "
-
-// where can we find infos about the subject
-documentQuery = "SELECT DISTINCT ?document "+
- FromPart+
- "WHERE{?s ?p1 ?subjectpattern. ?s <http://www.w3.org/2000/01/rdf-schema#seeAlso> ?document."+
- "FILTER regex(?subjectpattern, '.*"+wildcard2+".*', 'i').}"
-log.info(documentQuery)
-//context.sendMessageToUser(documentQuery)
-
-documents = context.queryForTable(documentQuery,null,null)
-FromNamedPart = ""
-documents.each(){
- res = it
- log.info(res.getResultCount())
- res.getResultRows().each(){
- FromNamedPart += "FROM <${it["document"]}> \n"
- log.info(it["document"])
- }
-}
-
-valueQuery = "SELECT DISTINCT ?value "+
- FromPart+
- FromNamedPart+
- "WHERE {?s ?p1 ?subjectpattern. ?s ?p2 ?value. ?p2 ?property ?propertypattern. FILTER regex(?subjectpattern, '.*"+wildcard2+".*', 'i'). FILTER regex(?propertypattern, '.*"+wildcard1+".*', 'i')}"
-log.info(valueQuery)
-//context.sendMessageToUser(valueQuery)
-
-counter = 0;
-values = context.queryForTable(valueQuery,null,null)
-values.each(){
- res = it
- counter = counter + res.getResultCount()
- if (res.getResultCount() > 0) context.sendMessageToUser("From " + res.getStoreName() + ":")
- log.info(res.getResultCount())
- res.getResultRows().each(){
- log.info(it["value"])
- context.sendMessageToUser(" * "+it["value"])
- }
-}
-if(counter == 0) context.sendMessageToUser("Sorry, I can't answer your question.")
-
Deleted: trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/iCalWhereNow.groovy
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/iCalWhereNow.groovy 2008-01-17 11:51:28 UTC (rev 100)
+++ trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/iCalWhereNow.groovy 2008-01-17 20:27:52 UTC (rev 101)
@@ -1,70 +0,0 @@
-/////////////////////////////////////////////
-/// Implementation of "WHERE IS * NOW"
-/////////////////////////////////////////////
-sparqlresult=""
-//context.sendMessageToUser("ok, I'll try find out this.")
-
-now = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(new Date())
-//context.sendMessageToUser(now)
-
-// fetching the log
-log = context.getLog()
-
-// the wildcards
-wildcard1 = match.wildcard(bitoflife.chatterbean.Match.Section.PATTERN,1).trim();
-
-//FROM = "http://demo.ontowiki.net/model/export/?m=http%3A%2F%2Fbis.ontowiki.net%2F&output=xml"
-//FROM = "http://sebastian.dietzold.de/rdf/foaf.rdf"
-PREFIX = "PREFIX ical: <http://www.w3.org/2002/12/cal/ical#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n"
-FromPart = "FROM <http://xmlns.com/foaf/spec/index.rdf> "
-
-// where can we find infos about the subject
-documentQuery = PREFIX + "SELECT DISTINCT ?document "+
- FromPart+
- "WHERE{?s ?p1 ?subjectpattern. ?s rdfs:seeAlso ?document.\n"+
- "?document rdf:type ical:Vcalendar.\n"+
- "FILTER regex(?subjectpattern, '.*"+wildcard1+".*', 'i').}"
-log.info(documentQuery)
-//context.sendMessageToUser(documentQuery)
-
-documents = context.queryForTable(documentQuery,null,null)
-counter = 0;
-FromNamedPart = ""
-documents.each(){
- res = it
- counter = counter + res.getResultCount()
- log.info(res.getResultCount())
- res.getResultRows().each(){
- FromNamedPart += "FROM NAMED <${it["document"]}> \n"
- log.info(it["document"])
- }
-}
-
-if(counter < 1) context.sendMessageToUser("Sorry, I did not found any calendar in relation to '"+wildcard1+"'")
-else{
- context.sendMessageToUser("I have found "+counter+" calendar documents which are in relation '"+wildcard1+"' ...")
- whereQuery = PREFIX + "SELECT DISTINCT ?location ?graph ?g ?summary\n"+
- FromNamedPart+
- "WHERE { GRAPH ?g { \n"+
- "?s ical:dtstart ?sbn. ?sbn ical:dateTime ?stime. \n"+
- "?s ical:dtend ?ebn. ?ebn ical:dateTime ?etime. \n"+
- "?s ical:location ?location. \n"+
- "?s ical:summary ?summary. \n"+
- "FILTER (?stime < '"+now+"') \n"+
- "FILTER (?etime > '"+now+"') \n"+
- "} OPTIONAL {?g rdfs:label ?graph} }"
-
- //context.sendMessageToUser(whereQuery)
- locations = context.queryForTable(whereQuery,null,null)
- counter = 0;
- locations.each(){
- res = it
- counter = counter + res.getResultCount()
- log.info(res.getResultCount())
- res.getResultRows().each(){
- log.info(it["location"])
- context.sendMessageToUser(it["location"] + " (summary: " + it["summary"] + ")")
- }
- }
-}
-
Deleted: trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/sample.groovy
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/sample.groovy 2008-01-17 11:51:28 UTC (rev 100)
+++ trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/sample.groovy 2008-01-17 20:27:52 UTC (rev 101)
@@ -1,125 +0,0 @@
-// fetching the log
-log = context.getLog()
-
-//sample query
-
-//context is a instance of net.sf.xoperator.ui.aiml.TemplateExecutionContext
-
-resultset = context.queryForTable("select distinct ?x, ?ypsilon WHERE {?ypsilon a ?x } LIMIT 10",null,null)
-
-resultset.each(){
-
- res = it
- log.info(res.getResultCount())
- // res.getResultRows returns a List of Maps. Each map represents a row, with the headline as key.
- res.getResultRows().each(){
- log.info("Hohoho: ${it["ypsilon"]} is a ${it["x"]}")
-
- }
-
-
- res.getHeadlines().each{
- log.info("Headline: ${it} contains:");
-
- res.getResultColumnAsStrings(it).each(){
- log.info(it)
- }
-
- res.getResultColumnAsElements(it).each(){
- log.info("${it.text} is of type ${it.name}")
- }
- }
-}
-
-sparqlresult ="select distinct ?x WHERE {?y a ?x } LIMIT 10"
-*/
-
-
-
-
-
-
-//***********************************
-
-// log message
-log.info("seebi.groovy: start")
-
-//we will have the following variables for an easy access
-//$wildcards, an array of the wilcards of the pattern, filled with the appropriate values
-//$roster, the xmpp roster
-//$stores, the data stores
-
-//in the end the values of the variables have to be set to approriate values, but anyway
-
-// this is an object of the namespace manager class
-// namespaces.toSparqlPrefix -> sparql prefix string "PREFIX ical: ..."
-toSparqlPrefix = "PREFIX ical: <http://www.w3.org/2002/12/cal/ical#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "
-
-wildcards = []
-storesToAsk = []
-friendsToAks = []
-groupsToAsk = []
-sparqlresult = ""
-
-context.sendMessageToUser("ok, I'll try find out this.")
-/////////////////////////////////////////////
-/// Implementation of the simple template "Tell me * of *"
-/////////////////////////////////////////////
-wildcards = ["Raum", "Frank"]
-sparqlresult = "SELECT DISTINCT ?value FROM <http://bis.ontowiki.net/> WHERE {?s ?p1 ?subjectpattern. ?s ?p2 ?value. ?p2 ?property ?propertypattern. FILTER regex(?subjectpattern, '.*"+wildcards[1]+".*', 'i'). FILTER regex(?propertypattern, '.*"+wildcards[0]+".*', 'i')}"
-/////////////////////////////////////////////
-sparqlresult = ""
-
-/////////////////////////////////////////////
-/// Implementation of the subtemplate "Where the hell is *"
-/// this is usable with the generic datastore http://www.sparql.org/sparql
-/////////////////////////////////////////////
-wildcards = ["Dietzold"]
-wildcard1 = match.wildcard(bitoflife.chatterbean.Match.Section.PATTERN,1).trim();
-log.info("wildcard1: " + wildcard1)
-
-// this is a subquery
-iCalsRequest = toSparqlPrefix +"SELECT DISTINCT ?g "+
- "FROM <http://demo.ontowiki.net/model/export/?m=http%3A%2F%2Fbis.ontowiki.net%2F&output=xml> "+
- "WHERE { "+
- "?person ?labelprop ?labelpattern. ?person rdfs:seeAlso ?g. "+
- "?g rdf:type ical:Vcalendar. "+
- "FILTER regex(?labelpattern, '.*"+wildcard1+".*', 'i')}"
-log.info(iCalsRequest)
-
-// generate the from-part from the calendar URIs
-FromNamedPart = ""
-iCals = context.queryForTable(iCalsRequest,null,null)
-iCals[0].getResultRowAsStrings("g").each(){
- log.info(it)
- FromNamedPart += "FROM NAMED <" + it + "> \n"
-}
-
-// we do not have the now method so this is static to
-now = "2007-11-23T17:00:00"
-sparqlresult = toSparqlPrefix +"SELECT DISTINCT ?location ?graph \n"+
- "FROM <http://demo.ontowiki.net/model/export/?m=http%3A%2F%2Fbis.ontowiki.net%2F&output=xml> \n"+
- FromNamedPart+
- "WHERE { GRAPH ?g { \n"+
- "?s ical:dtstart ?sbn. ?sbn ical:dateTime ?stime. \n"+
- "?s ical:dtend ?ebn. ?ebn ical:dateTime ?etime. \n"+
- "?s ical:location ?location. \n"+
- "FILTER (?stime < '"+now+"') \n"+
- "FILTER (?etime > '"+now+"') \n"+
- "} OPTIONAL {?g rdfs:label ?graph} }"
-//println sparqlresult
-/////////////////////////////////////////////
-log.info(sparqlresult)
-results = context.queryForTable(sparqlresult,null,null)
-results[0].getResultRowAsStrings("location").each(){
- context.sendMessageToUser(it)
- // hier bitte den richtigen code rein
- context.sendMessageToUser("According to g, he/she is in 'location'")
-}
-
-
-
-sparqlresult = ""
-// log message
-log.info("seebi.groovy: end")
-
Deleted: trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/tellMeMoreAbout.groovy
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/tellMeMoreAbout.groovy 2008-01-17 11:51:28 UTC (rev 100)
+++ trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/tellMeMoreAbout.groovy 2008-01-17 20:27:52 UTC (rev 101)
@@ -1,36 +0,0 @@
-/////////////////////////////////////////////
-/// Tell me more about *
-/////////////////////////////////////////////
-sparqlresult=""
-//context.sendMessageToUser("ok, I'll try find out this.")
-
-//now = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(new Date())
-//context.sendMessageToUser(now)
-
-// fetching the log
-log = context.getLog()
-
-// the wildcards
-wildcard1 = match.wildcard(bitoflife.chatterbean.Match.Section.PATTERN,1).trim();
-
-// query for member names
-memberQuery = "SELECT DISTINCT ?name FROM <http://xmlns.com/foaf/spec/index.rdf> WHERE {"+
- "?s ?p1 ?subjectpattern. ?s <http://xmlns.com/foaf/0.1/member> ?person. ?person <http://xmlns.com/foaf/0.1/name> ?name."+
- "FILTER regex(?subjectpattern, '.*"+wildcard1+".*', 'i').}"
-log.info(memberQuery)
-//context.sendMessageToUser(documentQuery)
-
-counter = 0;
-members = context.queryForTable(memberQuery,null,null)
-members.each(){
- res = it
- counter = counter + res.getResultCount()
- if (res.getResultCount() > 0) context.sendMessageToUser("From " + res.getStoreName() + ":")
- log.info(res.getResultCount())
- res.getResultRows().each(){
- log.info(it["name"])
- context.sendMessageToUser(" * "+it["name"])
- }
-}
-if(counter == 0) context.sendMessageToUser("Sorry, I can't answer your question.")
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|