You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(120) |
Sep
(36) |
Oct
(116) |
Nov
(17) |
Dec
(44) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(143) |
Feb
(192) |
Mar
(74) |
Apr
(84) |
May
(105) |
Jun
(64) |
Jul
(49) |
Aug
(120) |
Sep
(159) |
Oct
(156) |
Nov
(51) |
Dec
(28) |
2009 |
Jan
(17) |
Feb
(55) |
Mar
(33) |
Apr
(57) |
May
(54) |
Jun
(28) |
Jul
(6) |
Aug
(16) |
Sep
(38) |
Oct
(30) |
Nov
(26) |
Dec
(52) |
2010 |
Jan
(7) |
Feb
(91) |
Mar
(65) |
Apr
(2) |
May
(14) |
Jun
(25) |
Jul
(38) |
Aug
(48) |
Sep
(80) |
Oct
(70) |
Nov
(75) |
Dec
(77) |
2011 |
Jan
(68) |
Feb
(53) |
Mar
(51) |
Apr
(35) |
May
(65) |
Jun
(101) |
Jul
(29) |
Aug
(230) |
Sep
(95) |
Oct
(49) |
Nov
(110) |
Dec
(63) |
2012 |
Jan
(41) |
Feb
(42) |
Mar
(25) |
Apr
(46) |
May
(51) |
Jun
(44) |
Jul
(45) |
Aug
(29) |
Sep
(12) |
Oct
(9) |
Nov
(17) |
Dec
(2) |
2013 |
Jan
(12) |
Feb
(14) |
Mar
(7) |
Apr
(16) |
May
(54) |
Jun
(27) |
Jul
(11) |
Aug
(5) |
Sep
(85) |
Oct
(27) |
Nov
(37) |
Dec
(32) |
2014 |
Jan
(8) |
Feb
(29) |
Mar
(5) |
Apr
(3) |
May
(22) |
Jun
(3) |
Jul
(4) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <jen...@us...> - 2008-02-08 08:59:37
|
Revision: 527 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=527&view=rev Author: jenslehmann Date: 2008-02-08 00:59:26 -0800 (Fri, 08 Feb 2008) Log Message: ----------- added JavaCC Prolog parser Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/parser/package.html Added Paths: ----------- trunk/src/dl-learner/org/dllearner/parser/PrologParser.java trunk/src/dl-learner/org/dllearner/parser/PrologParserConstants.java trunk/src/dl-learner/org/dllearner/parser/PrologParserTokenManager.java trunk/src/dl-learner/org/dllearner/parser/prolog.jj Added: trunk/src/dl-learner/org/dllearner/parser/PrologParser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/PrologParser.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/parser/PrologParser.java 2008-02-08 08:59:26 UTC (rev 527) @@ -0,0 +1,773 @@ +/* Generated By:JavaCC: Do not edit this line. PrologParser.java */ +package org.dllearner.parser; + +public @SuppressWarnings("all") class PrologParser implements PrologParserConstants { + public PrologParser() { + this(new java.io.StringReader("")); + } + + public org.dllearner.prolog.Term parseTerm(String src) throws ParseException { + reinitToString(src); + return term(); + } + + public java.util.ArrayList parseTermList(String src) throws ParseException { + reinitToString(src); + return termList(); + } + + public org.dllearner.prolog.Atom parseAtom(String src) throws ParseException { + reinitToString(src); + return atom(); + } + + public org.dllearner.prolog.Clause parseClause(String src) throws ParseException { + reinitToString(src); + return clause(); + } + + public org.dllearner.prolog.Program parseProgram(String src) throws ParseException { + reinitToString(src); + return program(); + } + + private void reinitToString(String src) { + ReInit(new java.io.StringReader(src)); + } + +////////////////////////////////////////////////////////////////////////////////////////// + final public org.dllearner.prolog.Program program() throws ParseException { + org.dllearner.prolog.Program p = new org.dllearner.prolog.Program(); + org.dllearner.prolog.Clause c; + label_1: + while (true) { + c = clause(); + p.addClause(c); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + ; + break; + default: + jj_la1[0] = jj_gen; + break label_1; + } + } + jj_consume_token(0); + {if (true) return p;} + throw new Error("Missing return statement in function"); + } + + final public org.dllearner.prolog.Clause clause() throws ParseException { + org.dllearner.prolog.Atom head; + org.dllearner.prolog.Body body = null; + head = atom(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case 18: + jj_consume_token(18); + body = body(); + break; + default: + jj_la1[1] = jj_gen; + ; + } + jj_consume_token(19); + {if (true) return new org.dllearner.prolog.Clause(head, body);} + throw new Error("Missing return statement in function"); + } + + final public org.dllearner.prolog.Body body() throws ParseException { + org.dllearner.prolog.Literal l; + org.dllearner.prolog.Body b = new org.dllearner.prolog.Body(); + l = literal(); + b.addLiteral(l); + label_2: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case 20: + ; + break; + default: + jj_la1[2] = jj_gen; + break label_2; + } + jj_consume_token(20); + l = literal(); + b.addLiteral(l); + } + {if (true) return b;} + throw new Error("Missing return statement in function"); + } + + final public org.dllearner.prolog.Atom atom() throws ParseException { + Token atom; + java.util.ArrayList arguments = new java.util.ArrayList() ; + atom = jj_consume_token(IDENTIFIER); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case 21: + jj_consume_token(21); + arguments = termList(); + jj_consume_token(22); + break; + default: + jj_la1[3] = jj_gen; + ; + } + {if (true) return new org.dllearner.prolog.Atom(atom.image, arguments);} + throw new Error("Missing return statement in function"); + } + + final public org.dllearner.prolog.Literal literal() throws ParseException { + org.dllearner.prolog.Atom a; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + a = atom(); + {if (true) return new org.dllearner.prolog.Literal(a, true);} + break; + case NOT: + jj_consume_token(NOT); + a = atom(); + {if (true) return new org.dllearner.prolog.Literal(a, false);} + break; + default: + jj_la1[4] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + throw new Error("Missing return statement in function"); + } + + final public org.dllearner.prolog.Term term() throws ParseException { + Token v; + String o; + Token f; + java.util.ArrayList arguments = null; + org.dllearner.prolog.Term t1, t2; + if (jj_2_1(2147483647)) { + o = prefixOp(); + t2 = simpleTerm(); + {if (true) return new org.dllearner.prolog.Function(o, t2);} + } else if (jj_2_2(2147483647)) { + t1 = simpleTerm(); + o = infixOp(); + t2 = simpleTerm(); + {if (true) return new org.dllearner.prolog.Function(t1, o, t2);} + } else if (jj_2_3(2147483647)) { + t1 = simpleTerm(); + o = postfixOp(); + {if (true) return new org.dllearner.prolog.Function(t1, o);} + } else if (jj_2_4(2147483647)) { + t1 = simpleTerm(); + {if (true) return t1;} + } else { + jj_consume_token(-1); + throw new ParseException(); + } + throw new Error("Missing return statement in function"); + } + + final public org.dllearner.prolog.Term simpleTerm() throws ParseException { + Token v; + String o; + Token f; + java.util.ArrayList arguments = null; + org.dllearner.prolog.Term l; + if (jj_2_5(2)) { + f = jj_consume_token(IDENTIFIER); + jj_consume_token(21); + arguments = termList(); + jj_consume_token(22); + {if (true) return new org.dllearner.prolog.Function(f.image, arguments);} + } else if (jj_2_6(2)) { + f = jj_consume_token(IDENTIFIER); + {if (true) return new org.dllearner.prolog.PrologConstant(f.image);} + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case VAR: + v = jj_consume_token(VAR); + {if (true) return new org.dllearner.prolog.Variable(v.image);} + break; + case NUMBER: + v = jj_consume_token(NUMBER); + {if (true) return new org.dllearner.prolog.Number(v.image);} + break; + case STRINGCONSTANT: + v = jj_consume_token(STRINGCONSTANT); + {if (true) return new org.dllearner.prolog.StringConstant(v.image);} + break; + case 23: + case 24: + l = list(); + {if (true) return l;} + break; + default: + jj_la1[5] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + throw new Error("Missing return statement in function"); + } + + final public String prefixOp() throws ParseException { + Token f; + f = jj_consume_token(OPERATOR); + {if (true) return f.image;} + throw new Error("Missing return statement in function"); + } + + final public String infixOp() throws ParseException { + Token f; + f = jj_consume_token(OPERATOR); + {if (true) return f.image;} + throw new Error("Missing return statement in function"); + } + + final public String postfixOp() throws ParseException { + Token f; + f = jj_consume_token(OPERATOR); + {if (true) return f.image;} + throw new Error("Missing return statement in function"); + } + + final public java.util.ArrayList termList() throws ParseException { + org.dllearner.prolog.Term t; + java.util.ArrayList l = new java.util.ArrayList(); + t = term(); + l.add(t); + label_3: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case 20: + ; + break; + default: + jj_la1[6] = jj_gen; + break label_3; + } + jj_consume_token(20); + t = term(); + l.add(t); + } + {if (true) return l;} + throw new Error("Missing return statement in function"); + } + + final public org.dllearner.prolog.List list() throws ParseException { + java.util.ArrayList content = null; + org.dllearner.prolog.Term head; + org.dllearner.prolog.List l; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case 23: + jj_consume_token(23); + {if (true) return new org.dllearner.prolog.List();} + break; + default: + jj_la1[7] = jj_gen; + if (jj_2_7(3)) { + jj_consume_token(24); + head = term(); + jj_consume_token(25); + {if (true) return new org.dllearner.prolog.List(head, null);} + } else if (jj_2_8(3)) { + jj_consume_token(24); + head = term(); + jj_consume_token(26); + l = list(); + jj_consume_token(25); + {if (true) return new org.dllearner.prolog.List(head, l);} + } else { + jj_consume_token(-1); + throw new ParseException(); + } + } + throw new Error("Missing return statement in function"); + } + + final private boolean jj_2_1(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_1(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(0, xla); } + } + + final private boolean jj_2_2(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_2(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(1, xla); } + } + + final private boolean jj_2_3(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_3(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(2, xla); } + } + + final private boolean jj_2_4(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_4(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(3, xla); } + } + + final private boolean jj_2_5(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_5(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(4, xla); } + } + + final private boolean jj_2_6(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_6(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(5, xla); } + } + + final private boolean jj_2_7(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_7(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(6, xla); } + } + + final private boolean jj_2_8(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_8(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(7, xla); } + } + + final private boolean jj_3R_4() { + if (jj_scan_token(OPERATOR)) return true; + return false; + } + + final private boolean jj_3R_12() { + if (jj_3R_14()) return true; + return false; + } + + final private boolean jj_3R_11() { + if (jj_scan_token(STRINGCONSTANT)) return true; + return false; + } + + final private boolean jj_3R_10() { + if (jj_scan_token(NUMBER)) return true; + return false; + } + + final private boolean jj_3R_9() { + if (jj_scan_token(VAR)) return true; + return false; + } + + final private boolean jj_3_6() { + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + final private boolean jj_3_8() { + if (jj_scan_token(24)) return true; + if (jj_3R_8()) return true; + if (jj_scan_token(26)) return true; + if (jj_3R_14()) return true; + if (jj_scan_token(25)) return true; + return false; + } + + final private boolean jj_3_5() { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_scan_token(21)) return true; + if (jj_3R_13()) return true; + if (jj_scan_token(22)) return true; + return false; + } + + final private boolean jj_3R_5() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_5()) { + jj_scanpos = xsp; + if (jj_3_6()) { + jj_scanpos = xsp; + if (jj_3R_9()) { + jj_scanpos = xsp; + if (jj_3R_10()) { + jj_scanpos = xsp; + if (jj_3R_11()) { + jj_scanpos = xsp; + if (jj_3R_12()) return true; + } + } + } + } + } + return false; + } + + final private boolean jj_3_7() { + if (jj_scan_token(24)) return true; + if (jj_3R_8()) return true; + if (jj_scan_token(25)) return true; + return false; + } + + final private boolean jj_3R_16() { + if (jj_scan_token(23)) return true; + return false; + } + + final private boolean jj_3R_14() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_16()) { + jj_scanpos = xsp; + if (jj_3_7()) { + jj_scanpos = xsp; + if (jj_3_8()) return true; + } + } + return false; + } + + final private boolean jj_3_4() { + if (jj_3R_5()) return true; + return false; + } + + final private boolean jj_3R_15() { + if (jj_scan_token(20)) return true; + if (jj_3R_8()) return true; + return false; + } + + final private boolean jj_3_3() { + if (jj_3R_5()) return true; + if (jj_3R_7()) return true; + return false; + } + + final private boolean jj_3_2() { + if (jj_3R_5()) return true; + if (jj_3R_6()) return true; + if (jj_3R_5()) return true; + return false; + } + + final private boolean jj_3R_13() { + if (jj_3R_8()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_15()) { jj_scanpos = xsp; break; } + } + return false; + } + + final private boolean jj_3_1() { + if (jj_3R_4()) return true; + if (jj_3R_5()) return true; + return false; + } + + final private boolean jj_3R_8() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_1()) { + jj_scanpos = xsp; + if (jj_3_2()) { + jj_scanpos = xsp; + if (jj_3_3()) { + jj_scanpos = xsp; + if (jj_3_4()) return true; + } + } + } + return false; + } + + final private boolean jj_3R_7() { + if (jj_scan_token(OPERATOR)) return true; + return false; + } + + final private boolean jj_3R_6() { + if (jj_scan_token(OPERATOR)) return true; + return false; + } + + public PrologParserTokenManager token_source; + SimpleCharStream jj_input_stream; + public Token token, jj_nt; + private int jj_ntk; + private Token jj_scanpos, jj_lastpos; + private int jj_la; + public boolean lookingAhead = false; + private boolean jj_semLA; + private int jj_gen; + final private int[] jj_la1 = new int[8]; + static private int[] jj_la1_0; + static { + jj_la1_0(); + } + private static void jj_la1_0() { + jj_la1_0 = new int[] {0x1000,0x40000,0x100000,0x200000,0x1080,0x1800d00,0x100000,0x800000,}; + } + final private JJCalls[] jj_2_rtns = new JJCalls[8]; + private boolean jj_rescan = false; + private int jj_gc = 0; + + public PrologParser(java.io.InputStream stream) { + this(stream, null); + } + public PrologParser(java.io.InputStream stream, String encoding) { + try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source = new PrologParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 8; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + public void ReInit(java.io.InputStream stream) { + ReInit(stream, null); + } + public void ReInit(java.io.InputStream stream, String encoding) { + try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 8; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + public PrologParser(java.io.Reader stream) { + jj_input_stream = new SimpleCharStream(stream, 1, 1); + token_source = new PrologParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 8; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + public void ReInit(java.io.Reader stream) { + jj_input_stream.ReInit(stream, 1, 1); + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 8; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + public PrologParser(PrologParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 8; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + public void ReInit(PrologParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 8; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + final private Token jj_consume_token(int kind) throws ParseException { + Token oldToken; + if ((oldToken = token).next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + if (token.kind == kind) { + jj_gen++; + if (++jj_gc > 100) { + jj_gc = 0; + for (int i = 0; i < jj_2_rtns.length; i++) { + JJCalls c = jj_2_rtns[i]; + while (c != null) { + if (c.gen < jj_gen) c.first = null; + c = c.next; + } + } + } + return token; + } + token = oldToken; + jj_kind = kind; + throw generateParseException(); + } + + static private final class LookaheadSuccess extends java.lang.Error { } + final private LookaheadSuccess jj_ls = new LookaheadSuccess(); + final private boolean jj_scan_token(int kind) { + if (jj_scanpos == jj_lastpos) { + jj_la--; + if (jj_scanpos.next == null) { + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); + } else { + jj_lastpos = jj_scanpos = jj_scanpos.next; + } + } else { + jj_scanpos = jj_scanpos.next; + } + if (jj_rescan) { + int i = 0; Token tok = token; + while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } + if (tok != null) jj_add_error_token(kind, i); + } + if (jj_scanpos.kind != kind) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; + return false; + } + + final public Token getNextToken() { + if (token.next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + jj_gen++; + return token; + } + + final public Token getToken(int index) { + Token t = lookingAhead ? jj_scanpos : token; + for (int i = 0; i < index; i++) { + if (t.next != null) t = t.next; + else t = t.next = token_source.getNextToken(); + } + return t; + } + + final private int jj_ntk() { + if ((jj_nt=token.next) == null) + return (jj_ntk = (token.next=token_source.getNextToken()).kind); + else + return (jj_ntk = jj_nt.kind); + } + + private java.util.Vector<int[]> jj_expentries = new java.util.Vector<int[]>(); + private int[] jj_expentry; + private int jj_kind = -1; + private int[] jj_lasttokens = new int[100]; + private int jj_endpos; + + private void jj_add_error_token(int kind, int pos) { + if (pos >= 100) return; + if (pos == jj_endpos + 1) { + jj_lasttokens[jj_endpos++] = kind; + } else if (jj_endpos != 0) { + jj_expentry = new int[jj_endpos]; + for (int i = 0; i < jj_endpos; i++) { + jj_expentry[i] = jj_lasttokens[i]; + } + boolean exists = false; + for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) { + int[] oldentry = (int[])(e.nextElement()); + if (oldentry.length == jj_expentry.length) { + exists = true; + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + exists = false; + break; + } + } + if (exists) break; + } + } + if (!exists) jj_expentries.addElement(jj_expentry); + if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + + public ParseException generateParseException() { + jj_expentries.removeAllElements(); + boolean[] la1tokens = new boolean[27]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 8; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1<<j)) != 0) { + la1tokens[j] = true; + } + } + } + } + for (int i = 0; i < 27; i++) { + if (la1tokens[i]) { + jj_expentry = new int[1]; + jj_expentry[0] = i; + jj_expentries.addElement(jj_expentry); + } + } + jj_endpos = 0; + jj_rescan_token(); + jj_add_error_token(0, 0); + int[][] exptokseq = new int[jj_expentries.size()][]; + for (int i = 0; i < jj_expentries.size(); i++) { + exptokseq[i] = jj_expentries.elementAt(i); + } + return new ParseException(token, exptokseq, tokenImage); + } + + final public void enable_tracing() { + } + + final public void disable_tracing() { + } + + final private void jj_rescan_token() { + jj_rescan = true; + for (int i = 0; i < 8; i++) { + try { + JJCalls p = jj_2_rtns[i]; + do { + if (p.gen > jj_gen) { + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: jj_3_1(); break; + case 1: jj_3_2(); break; + case 2: jj_3_3(); break; + case 3: jj_3_4(); break; + case 4: jj_3_5(); break; + case 5: jj_3_6(); break; + case 6: jj_3_7(); break; + case 7: jj_3_8(); break; + } + } + p = p.next; + } while (p != null); + } catch(LookaheadSuccess ls) { } + } + jj_rescan = false; + } + + final private void jj_save(int index, int xla) { + JJCalls p = jj_2_rtns[index]; + while (p.gen > jj_gen) { + if (p.next == null) { p = p.next = new JJCalls(); break; } + p = p.next; + } + p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; + } + + static final class JJCalls { + int gen; + Token first; + int arg; + JJCalls next; + } + +} Added: trunk/src/dl-learner/org/dllearner/parser/PrologParserConstants.java =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/PrologParserConstants.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/parser/PrologParserConstants.java 2008-02-08 08:59:26 UTC (rev 527) @@ -0,0 +1,52 @@ +/* Generated By:JavaCC: Do not edit this line. PrologParserConstants.java */ +package org.dllearner.parser; + +public @SuppressWarnings("all") interface PrologParserConstants { + + int EOF = 0; + int SINGLE_LINE_COMMENT = 6; + int NOT = 7; + int NUMBER = 8; + int DIGIT = 9; + int STRINGCONSTANT = 10; + int VAR = 11; + int IDENTIFIER = 12; + int OPERATOR = 13; + int ANYCHAR = 14; + int LOCASE = 15; + int HICASE = 16; + int SPECIALCHAR = 17; + + int DEFAULT = 0; + + String[] tokenImage = { + "<EOF>", + "\" \"", + "\"\\t\"", + "\"\\n\"", + "\"\\r\"", + "\"\\f\"", + "<SINGLE_LINE_COMMENT>", + "\"not\"", + "<NUMBER>", + "<DIGIT>", + "<STRINGCONSTANT>", + "<VAR>", + "<IDENTIFIER>", + "<OPERATOR>", + "<ANYCHAR>", + "<LOCASE>", + "<HICASE>", + "<SPECIALCHAR>", + "\":-\"", + "\".\"", + "\",\"", + "\"(\"", + "\")\"", + "\"[]\"", + "\"[\"", + "\"]\"", + "\"|\"", + }; + +} Added: trunk/src/dl-learner/org/dllearner/parser/PrologParserTokenManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/PrologParserTokenManager.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/parser/PrologParserTokenManager.java 2008-02-08 08:59:26 UTC (rev 527) @@ -0,0 +1,578 @@ +/* Generated By:JavaCC: Do not edit this line. PrologParserTokenManager.java */ +package org.dllearner.parser; + +public @SuppressWarnings("all") class PrologParserTokenManager implements PrologParserConstants +{ + public java.io.PrintStream debugStream = System.out; + public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } +private final int jjStopStringLiteralDfa_0(int pos, long active0) +{ + switch (pos) + { + case 0: + if ((active0 & 0x80L) != 0L) + { + jjmatchedKind = 12; + return 18; + } + return -1; + case 1: + if ((active0 & 0x80L) != 0L) + { + jjmatchedKind = 12; + jjmatchedPos = 1; + return 18; + } + return -1; + default : + return -1; + } +} +private final int jjStartNfa_0(int pos, long active0) +{ + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); +} +private final int jjStopAtPos(int pos, int kind) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + return pos + 1; +} +private final int jjStartNfaWithStates_0(int pos, int kind, int state) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return pos + 1; } + return jjMoveNfa_0(state, pos + 1); +} +private final int jjMoveStringLiteralDfa0_0() +{ + switch(curChar) + { + case 40: + return jjStopAtPos(0, 21); + case 41: + return jjStopAtPos(0, 22); + case 44: + return jjStopAtPos(0, 20); + case 46: + return jjStopAtPos(0, 19); + case 58: + return jjMoveStringLiteralDfa1_0(0x40000L); + case 91: + jjmatchedKind = 24; + return jjMoveStringLiteralDfa1_0(0x800000L); + case 93: + return jjStopAtPos(0, 25); + case 110: + return jjMoveStringLiteralDfa1_0(0x80L); + case 124: + return jjStopAtPos(0, 26); + default : + return jjMoveNfa_0(0, 0); + } +} +private final int jjMoveStringLiteralDfa1_0(long active0) +{ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(0, active0); + return 1; + } + switch(curChar) + { + case 45: + if ((active0 & 0x40000L) != 0L) + return jjStopAtPos(1, 18); + break; + case 93: + if ((active0 & 0x800000L) != 0L) + return jjStopAtPos(1, 23); + break; + case 111: + return jjMoveStringLiteralDfa2_0(active0, 0x80L); + default : + break; + } + return jjStartNfa_0(0, active0); +} +private final int jjMoveStringLiteralDfa2_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(0, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(1, active0); + return 2; + } + switch(curChar) + { + case 116: + if ((active0 & 0x80L) != 0L) + return jjStartNfaWithStates_0(2, 7, 18); + break; + default : + break; + } + return jjStartNfa_0(1, active0); +} +private final void jjCheckNAdd(int state) +{ + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } +} +private final void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +private final void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} +private final void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} +private final void jjCheckNAddStates(int start) +{ + jjCheckNAdd(jjnextStates[start]); + jjCheckNAdd(jjnextStates[start + 1]); +} +static final long[] jjbitVec0 = { + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +private final int jjMoveNfa_0(int startState, int curPos) +{ + int[] nextStates; + int startsAt = 0; + jjnewStateCnt = 18; + int i = 1; + jjstateSet[0] = startState; + int j, kind = 0x7fffffff; + for (;;) + { + if (++jjround == 0x7fffffff) + ReInitRounds(); + if (curChar < 64) + { + long l = 1L << curChar; + MatchLoop: do + { + switch(jjstateSet[--i]) + { + case 18: + if ((0x53ff2c0000000000L & l) != 0L) + { + if (kind > 13) + kind = 13; + jjCheckNAdd(17); + } + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 12) + kind = 12; + jjCheckNAdd(15); + } + break; + case 0: + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 8) + kind = 8; + jjCheckNAdd(5); + } + else if ((0x50002c0000000000L & l) != 0L) + { + if (kind > 13) + kind = 13; + jjCheckNAdd(17); + } + else if (curChar == 34) + jjCheckNAddTwoStates(10, 11); + else if (curChar == 39) + jjCheckNAddTwoStates(7, 8); + else if (curChar == 37) + jjCheckNAddStates(0, 2); + break; + case 1: + if ((0xffffffffffffdbffL & l) != 0L) + jjCheckNAddStates(0, 2); + break; + case 2: + if ((0x2400L & l) != 0L && kind > 6) + kind = 6; + break; + case 3: + if (curChar == 10 && kind > 6) + kind = 6; + break; + case 4: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 3; + break; + case 5: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 8) + kind = 8; + jjCheckNAdd(5); + break; + case 6: + if (curChar == 39) + jjCheckNAddTwoStates(7, 8); + break; + case 7: + if ((0xffffff7fffffdbffL & l) != 0L) + jjCheckNAddTwoStates(7, 8); + break; + case 8: + if (curChar == 39 && kind > 10) + kind = 10; + break; + case 9: + if (curChar == 34) + jjCheckNAddTwoStates(10, 11); + break; + case 10: + if ((0xffffff7fffffdbffL & l) != 0L) + jjCheckNAddTwoStates(10, 11); + break; + case 11: + if (curChar == 34 && kind > 10) + kind = 10; + break; + case 13: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 11) + kind = 11; + jjstateSet[jjnewStateCnt++] = 13; + break; + case 15: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 12) + kind = 12; + jjCheckNAdd(15); + break; + case 16: + if ((0x50002c0000000000L & l) == 0L) + break; + if (kind > 13) + kind = 13; + jjCheckNAdd(17); + break; + case 17: + if ((0x53ff2c0000000000L & l) == 0L) + break; + if (kind > 13) + kind = 13; + jjCheckNAdd(17); + break; + default : break; + } + } while(i != startsAt); + } + else if (curChar < 128) + { + long l = 1L << (curChar & 077); + MatchLoop: do + { + switch(jjstateSet[--i]) + { + case 18: + if ((0x7fffffec7fffffeL & l) != 0L) + { + if (kind > 13) + kind = 13; + jjCheckNAdd(17); + } + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 12) + kind = 12; + jjCheckNAdd(15); + } + break; + case 0: + if ((0x7fffffe40000000L & l) != 0L) + { + if (kind > 13) + kind = 13; + jjCheckNAdd(17); + } + else if ((0x87fffffeL & l) != 0L) + { + if (kind > 11) + kind = 11; + jjCheckNAdd(13); + } + if ((0x7fffffe00000000L & l) != 0L) + { + if (kind > 12) + kind = 12; + jjCheckNAdd(15); + } + break; + case 1: + jjAddStates(0, 2); + break; + case 7: + if ((0xffffffffefffffffL & l) != 0L) + jjAddStates(3, 4); + break; + case 10: + if ((0xffffffffefffffffL & l) != 0L) + jjAddStates(5, 6); + break; + case 12: + if ((0x87fffffeL & l) == 0L) + break; + if (kind > 11) + kind = 11; + jjCheckNAdd(13); + break; + case 13: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 11) + kind = 11; + jjCheckNAdd(13); + break; + case 14: + if ((0x7fffffe00000000L & l) == 0L) + break; + if (kind > 12) + kind = 12; + jjCheckNAdd(15); + break; + case 15: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 12) + kind = 12; + jjCheckNAdd(15); + break; + case 16: + if ((0x7fffffe40000000L & l) == 0L) + break; + if (kind > 13) + kind = 13; + jjCheckNAdd(17); + break; + case 17: + if ((0x7fffffec7fffffeL & l) == 0L) + break; + if (kind > 13) + kind = 13; + jjCheckNAdd(17); + break; + default : break; + } + } while(i != startsAt); + } + else + { + int i2 = (curChar & 0xff) >> 6; + long l2 = 1L << (curChar & 077); + MatchLoop: do + { + switch(jjstateSet[--i]) + { + case 1: + if ((jjbitVec0[i2] & l2) != 0L) + jjAddStates(0, 2); + break; + case 7: + if ((jjbitVec0[i2] & l2) != 0L) + jjAddStates(3, 4); + break; + case 10: + if ((jjbitVec0[i2] & l2) != 0L) + jjAddStates(5, 6); + break; + default : break; + } + } while(i != startsAt); + } + if (kind != 0x7fffffff) + { + jjmatchedKind = kind; + jjmatchedPos = curPos; + kind = 0x7fffffff; + } + ++curPos; + if ((i = jjnewStateCnt) == (startsAt = 18 - (jjnewStateCnt = startsAt))) + return curPos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return curPos; } + } +} +static final int[] jjnextStates = { + 1, 2, 4, 7, 8, 10, 11, +}; +public static final String[] jjstrLiteralImages = { +"", null, null, null, null, null, null, "\156\157\164", null, null, null, null, +null, null, null, null, null, null, "\72\55", "\56", "\54", "\50", "\51", +"\133\135", "\133", "\135", "\174", }; +public static final String[] lexStateNames = { + "DEFAULT", +}; +static final long[] jjtoToken = { + 0x7fc3d81L, +}; +static final long[] jjtoSkip = { + 0x7eL, +}; +static final long[] jjtoSpecial = { + 0x40L, +}; +protected SimpleCharStream input_stream; +private final int[] jjrounds = new int[18]; +private final int[] jjstateSet = new int[36]; +protected char curChar; +public PrologParserTokenManager(SimpleCharStream stream){ + if (SimpleCharStream.staticFlag) + throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); + input_stream = stream; +} +public PrologParserTokenManager(SimpleCharStream stream, int lexState){ + this(stream); + SwitchTo(lexState); +} +public void ReInit(SimpleCharStream stream) +{ + jjmatchedPos = jjnewStateCnt = 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); +} +private final void ReInitRounds() +{ + int i; + jjround = 0x80000001; + for (i = 18; i-- > 0;) + jjrounds[i] = 0x80000000; +} +public void ReInit(SimpleCharStream stream, int lexState) +{ + ReInit(stream); + SwitchTo(lexState); +} +public void SwitchTo(int lexState) +{ + if (lexState >= 1 || lexState < 0) + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); + else + curLexState = lexState; +} + +protected Token jjFillToken() +{ + Token t = Token.newToken(jjmatchedKind); + t.kind = jjmatchedKind; + String im = jjstrLiteralImages[jjmatchedKind]; + t.image = (im == null) ? input_stream.GetImage() : im; + t.beginLine = input_stream.getBeginLine(); + t.beginColumn = input_stream.getBeginColumn(); + t.endLine = input_stream.getEndLine(); + t.endColumn = input_stream.getEndColumn(); + return t; +} + +int curLexState = 0; +int defaultLexState = 0; +int jjnewStateCnt; +int jjround; +int jjmatchedPos; +int jjmatchedKind; + +public Token getNextToken() +{ + int kind; + Token specialToken = null; + Token matchedToken; + int curPos = 0; + + EOFLoop : + for (;;) + { + try + { + curChar = input_stream.BeginToken(); + } + catch(java.io.IOException e) + { + jjmatchedKind = 0; + matchedToken = jjFillToken(); + matchedToken.specialToken = specialToken; + return matchedToken; + } + + try { input_stream.backup(0); + while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) + curChar = input_stream.BeginToken(); + } + catch (java.io.IOException e1) { continue EOFLoop; } + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_0(); + if (jjmatchedKind != 0x7fffffff) + { + if (jjmatchedPos + 1 < curPos) + input_stream.backup(curPos - jjmatchedPos - 1); + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + matchedToken.specialToken = specialToken; + return matchedToken; + } + else + { + if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + if (specialToken == null) + specialToken = matchedToken; + else + { + matchedToken.specialToken = specialToken; + specialToken = (specialToken.next = matchedToken); + } + } + continue EOFLoop; + } + } + int error_line = input_stream.getEndLine(); + int error_column = input_stream.getEndColumn(); + String error_after = null; + boolean EOFSeen = false; + try { input_stream.readChar(); input_stream.backup(1); } + catch (java.io.IOException e1) { + EOFSeen = true; + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + if (curChar == '\n' || curChar == '\r') { + error_line++; + error_column = 0; + } + else + error_column++; + } + if (!EOFSeen) { + input_stream.backup(1); + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + } + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); + } +} + +} Modified: trunk/src/dl-learner/org/dllearner/parser/package.html =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/package.html 2008-02-08 08:57:28 UTC (rev 526) +++ trunk/src/dl-learner/org/dllearner/parser/package.html 2008-02-08 08:59:26 UTC (rev 527) @@ -2,6 +2,6 @@ <html> <head></head> <body bgcolor="white"> -<p>DL-Learner configuration file parser.</p> +<p>DL-Learner parsers. Contains a conf file parser, a KB file parser and a Prolog parser. All generated by JavaCC.</p> </body> </html> \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/parser/prolog.jj =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/prolog.jj (rev 0) +++ trunk/src/dl-learner/org/dllearner/parser/prolog.jj 2008-02-08 08:59:26 UTC (rev 527) @@ -0,0 +1,212 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +/** + * @author Sebastian Bader + * + */ + +options { + LOOKAHEAD = 1; + STATIC = false; +} + +PARSER_BEGIN(PrologParser) + +package org.dllearner.parser; + +public class PrologParser { + public PrologParser() { + this(new java.io.StringReader("")); + } + + public org.dllearner.prolog.Term parseTerm(String src) throws ParseException { + reinitToString(src); + return term(); + } + + public java.util.ArrayList parseTermList(String src) throws ParseException { + reinitToString(src); + return termList(); + } + + public org.dllearner.prolog.Atom parseAtom(String src) throws ParseException { + reinitToString(src); + return atom(); + } + + public org.dllearner.prolog.Clause parseClause(String src) throws ParseException { + reinitToString(src); + return clause(); + } + + public org.dllearner.prolog.Program parseProgram(String src) throws ParseException { + reinitToString(src); + return program(); + } + + private void reinitToString(String src) { + ReInit(new java.io.StringReader(src)); + } +} + +PARSER_END(PrologParser) + +SKIP : { /* WHITE SPACE */ + " " | "\t" | "\n" | "\r" | "\f" +} + +SPECIAL_TOKEN : { /* COMMENTS */ + <SINGLE_LINE_COMMENT: "%" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> +} + +TOKEN : /* RESERVED WORDS AND LITERALS */ +{ + < NOT: "not" > +} + +TOKEN : /* constants */ +{ + < NUMBER: (<DIGIT>)+> + | < #DIGIT: ["0" - "9"] > + | < STRINGCONSTANT: ("'" (~["'","\\","\n","\r"])* "'" | "\"" (~["'","\\","\n","\r"])* "\"" ) > +} + +TOKEN : /* Function names */ +{ + < VAR: ((<HICASE> | "_" ) (<ANYCHAR>)* ) > + | < IDENTIFIER: (<LOCASE>) (<ANYCHAR>)* > + | < OPERATOR: (<LOCASE> | <SPECIALCHAR>) (<ANYCHAR> | <SPECIALCHAR>)* > + | < #ANYCHAR: (<LOCASE> | <HICASE> | <DIGIT> | "_" ) > + | < #LOCASE: ["a"-"z"] > + | < #HICASE: ["A"-"Z"] > + | < #SPECIALCHAR: "-" | "+" | "*" | "<" | ">" | "^" > +} + +////////////////////////////////////////////////////////////////////////////////////////// + +org.dllearner.prolog.Program program() : { + org.dllearner.prolog.Program p = new org.dllearner.prolog.Program(); + org.dllearner.prolog.Clause c; +}{ + ( c = clause() { p.addClause(c); } )+ <EOF> { return p; } +} + +org.dllearner.prolog.Clause clause() : { + org.dllearner.prolog.Atom head; + org.dllearner.prolog.Body body = null; +}{ + head = atom() [ ":-" body = body() ] "." { return new org.dllearner.prolog.Clause(head, body); } +} + + +org.dllearner.prolog.Body body() : { + org.dllearner.prolog.Literal l; + org.dllearner.prolog.Body b = new org.dllearner.prolog.Body(); +}{ + l = literal() { b.addLiteral(l); } + ( "," l = literal() { b.addLiteral(l); } )* + { return b; } +} + +org.dllearner.prolog.Atom atom() : { + Token atom; + java.util.ArrayList arguments = new java.util.ArrayList() ; +}{ + atom = <IDENTIFIER> [ "(" arguments = termList() ")" ] { return new org.dllearner.prolog.Atom(atom.image, arguments); } +} + +org.dllearner.prolog.Literal literal() : { + org.dllearner.prolog.Atom a; +}{ + a = atom() { return new org.dllearner.prolog.Literal(a, true); } + | <NOT> a = atom() { return new org.dllearner.prolog.Literal(a, false); } +} + + +org.dllearner.prolog.Term term() : { + Token v; + String o; + Token f; + java.util.ArrayList arguments = null; + org.dllearner.prolog.Term t1, t2; +}{ + LOOKAHEAD(2147483647) o = prefixOp() t2 = simpleTerm() { return new org.dllearner.prolog.Function(o, t2); } + | LOOKAHEAD(2147483647) t1 = simpleTerm() o = infixOp() t2 = simpleTerm() { return new org.dllearner.prolog.Function(t1, o, t2); } + | LOOKAHEAD(2147483647) t1 = simpleTerm() o = postfixOp() { return new org.dllearner.prolog.Function(t1, o); } + | LOOKAHEAD(2147483647) t1 = simpleTerm() { return t1; } +} + + +org.dllearner.prolog.Term simpleTerm() : { + Token v; + String o; + Token f; + java.util.ArrayList arguments = null; + org.dllearner.prolog.Term l; +}{ + LOOKAHEAD(2) f = <IDENTIFIER> "(" arguments = termList() ")" { return new org.dllearner.prolog.Function(f.image, arguments); } + | LOOKAHEAD(2) f = <IDENTIFIER> { return new org.dllearner.prolog.PrologConstant(f.image); } + | v = <VAR> { return new org.dllearner.prolog.Variable(v.image); } + | v = <NUMBER> { return new org.dllearner.prolog.Number(v.image); } + | v = <STRINGCONSTANT> { return new org.dllearner.prolog.StringConstant(v.image); } + | l = list() { return l; } +} + + +String prefixOp() : { + Token f; +}{ + f = <OPERATOR> { return f.image; } +} + + +String infixOp() : { + Token f; +}{ + f = <OPERATOR> { return f.image; } +} + + +String postfixOp() : { + Token f; +}{ + f = <OPERATOR> { return f.image; } +} + + +java.util.ArrayList termList() : { + org.dllearner.prolog.Term t; + java.util.ArrayList l = new java.util.ArrayList(); +}{ + t = term() { l.add(t); } + ( "," t = term() { l.add(t); } )* + { return l; } +} + +org.dllearner.prolog.List list() : { + java.util.ArrayList content = null; + org.dllearner.prolog.Term head; + org.dllearner.prolog.List l; +}{ + "[]" { return new org.dllearner.prolog.List(); } + | LOOKAHEAD(3) "[" head = term() "]" { return new org.dllearner.prolog.List(head, null); } + | LOOKAHEAD(3) "[" head = term() "|" l = list() "]" { return new org.dllearner.prolog.List(head, l); } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-08 08:57:48
|
Revision: 526 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=526&view=rev Author: jenslehmann Date: 2008-02-08 00:57:28 -0800 (Fri, 08 Feb 2008) Log Message: ----------- added classes for supporting Prolog syntax (originally written by Sebastian Bader) Added Paths: ----------- trunk/src/dl-learner/org/dllearner/prolog/ trunk/src/dl-learner/org/dllearner/prolog/ArrayListSet.java trunk/src/dl-learner/org/dllearner/prolog/Atom.java trunk/src/dl-learner/org/dllearner/prolog/Body.java trunk/src/dl-learner/org/dllearner/prolog/Clause.java trunk/src/dl-learner/org/dllearner/prolog/Constant.java trunk/src/dl-learner/org/dllearner/prolog/Function.java trunk/src/dl-learner/org/dllearner/prolog/FunctionDefinition.java trunk/src/dl-learner/org/dllearner/prolog/List.java trunk/src/dl-learner/org/dllearner/prolog/Literal.java trunk/src/dl-learner/org/dllearner/prolog/Number.java trunk/src/dl-learner/org/dllearner/prolog/PredicateDefinition.java trunk/src/dl-learner/org/dllearner/prolog/Program.java trunk/src/dl-learner/org/dllearner/prolog/PrologConstant.java trunk/src/dl-learner/org/dllearner/prolog/StringConstant.java trunk/src/dl-learner/org/dllearner/prolog/Term.java trunk/src/dl-learner/org/dllearner/prolog/Variable.java Added: trunk/src/dl-learner/org/dllearner/prolog/ArrayListSet.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/ArrayListSet.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/ArrayListSet.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,69 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.Set; + +/** + * + * @author Sebastian Bader + * + * @param <T> + */ +public class ArrayListSet<T> extends ArrayList<T> implements Set<T> { + + private static final long serialVersionUID = 1530739499015312204L; + + public ArrayListSet() { + this(10); + } + + public ArrayListSet(int initialCapacity) { + super(initialCapacity); + } + + public ArrayListSet(Collection<T> c) { + this(c.size()); + addAll(c); + } + + @Override + public boolean add(T o) { + if (contains(o)) + return false; + return super.add(o); + } + + @Override + public boolean addAll(Collection<? extends T> c) { + Iterator<? extends T> iter = c.iterator(); + boolean ret = false; + while (iter.hasNext()) { + if (add(iter.next())) { + ret = true; + } + } + return ret; + } + +} Added: trunk/src/dl-learner/org/dllearner/prolog/Atom.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/Atom.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/Atom.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,131 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +import java.util.ArrayList; + +/** + * + * @author Sebastian Bader + * + */ +public class Atom { + String name; + ArrayList<Term> arguments; + + public Atom(String name, ArrayList<Term> arguments) { + super(); + this.name = name; + this.arguments = arguments; + } + + public ArrayList<Term> getArguments() { + return arguments; + } + + public String getName() { + return name; + } + + public boolean isGround() { + for (int i = 0; i < arguments.size(); i++) { + if (!getArgument(i).isGround()) + return false; + } + return true; + } + + public Term getArgument(int index) { + return arguments.get(index); + } + + public int getArity() { + return arguments.size(); + } + + /** + * + * @param variable + * Substitution variable. + * @param term + * A term. + * @return Returns a new instance of this term, where the variable is + * replaced by the term. + */ + public Atom getInstance(Variable variable, Term term) { + ArrayList<Term> newArgs = new ArrayList<Term>(arguments.size()); + for (int i = 0; i < arguments.size(); i++) { + Term argument = (Term) arguments.get(i); + newArgs.add(argument.getInstance(variable, term)); + } + return new Atom(name, newArgs); + } + + @Override + public String toString() { + StringBuffer ret = new StringBuffer("A[" + name + "/" + getArity() + "("); + for (int i = 0; i < arguments.size(); i++) { + ret.append(arguments.get(i).toString()); + if (i + 1 < arguments.size()) + ret.append(", "); + } + ret.append(")]"); + return ret.toString(); + } + + public String toPLString() { + StringBuffer ret = new StringBuffer(name + "("); + for (int i = 0; i < arguments.size(); i++) { + ret.append(((Term) arguments.get(i)).toPLString()); + if (i + 1 < arguments.size()) + ret.append(", "); + } + ret.append(")"); + return ret.toString(); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) + return false; + + Atom a; + + try { + a = (Atom) obj; + } catch (ClassCastException cce) { + return false; + } + + if (!name.equals(a.name)) + return false; + + if (arguments == null) + return a.arguments == null; + else + return arguments.equals(a.arguments); + } + + @Override + public int hashCode() { + return name.hashCode() * (getArity() + 1); + } + +} Added: trunk/src/dl-learner/org/dllearner/prolog/Body.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/Body.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/Body.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,93 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +import java.util.ArrayList; + +/** + * + * @author Sebastian Bader + * + */ +public class Body { + private ArrayList<Literal> literals; + + public Body() { + literals = new ArrayList<Literal>(); + } + + public void addLiteral(Literal literal) { + literals.add(literal); + } + + public ArrayList<Literal> getLiterals() { + return literals; + } + + public boolean isEmpty() { + return literals.isEmpty(); + } + + public boolean isGround() { + for (int i = 0; i < literals.size(); i++) { + if (!((Literal) literals.get(i)).isGround()) + return false; + } + + return true; + } + + public Body getInstance(Variable variable, Term term) { + Body newbody = new Body(); + + for (int i = 0; i < literals.size(); i++) { + Literal literal = (Literal) literals.get(i); + newbody.addLiteral(literal.getInstance(variable, term)); + } + + return newbody; + } + + @Override + public String toString() { + StringBuffer ret = new StringBuffer(); + + for (int i = 0; i < literals.size(); i++) { + ret.append(literals.get(i)); + if (i + 1 < literals.size()) + ret.append(", "); + } + + return ret.toString(); + } + + public String toPLString() { + StringBuffer ret = new StringBuffer(); + + for (int i = 0; i < literals.size(); i++) { + ret.append(((Literal) literals.get(i)).toPLString()); + if (i + 1 < literals.size()) + ret.append(", "); + } + + return ret.toString(); + } + +} Added: trunk/src/dl-learner/org/dllearner/prolog/Clause.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/Clause.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/Clause.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,85 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + + + +/** + * + * @author Sebastian Bader + * + */ +public class Clause { + private Atom head; + private Body body; + + public Clause(Atom head, Body body) { + this.head = head; + this.body = body; + if (body == null) + this.body = new Body(); + } + + @Override + public String toString() { + if (body.isEmpty()) + return head+"."; + return head + " :- " + body +"."; + } + + public String toPLString() { + if (body.isEmpty()) + return head.toPLString()+"."; + return head.toPLString() + " :- " + body.toPLString() +"."; + } + + public boolean isGround() { + if (!head.isGround()) + return false; + + return body.isGround(); + } + + public Body getBody() { + return body; + } + + public Atom getHead() { + return head; + } + + /** + * + * @param variable + * Substitution variable. + * @param term + * A term. + * @return Returns a new instance of this term, where the variable is + * replaced by the term. + */ + public Clause getInstance(Variable variable, Term term) { + Atom newhead = head.getInstance(variable, term); + Body newbody = body.getInstance(variable, term); + + return new Clause(newhead, newbody); + } + +} + Added: trunk/src/dl-learner/org/dllearner/prolog/Constant.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/Constant.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/Constant.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,28 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +/** + * + * @author Sebastian Bader + * + */ +public abstract class Constant extends Term { +} \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/prolog/Function.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/Function.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/Function.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,189 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +import java.util.ArrayList; + +/** + * + * @author Sebastian Bader + * + */ +public class Function extends Term { + + private String name; + private ArrayList<Term> arguments; + private int type; + + private Function(String name, int type) { + this.name = name; + this.type = type; + } + + private Function(String name, int type, ArrayList<Term> arguments) { + this.name = name; + this.type = type; + this.arguments = arguments; + } + + public Function(Function source) { + this(source.name, source.type); + arguments = new ArrayList<Term>(); + for (int i = 0; i < source.getArity(); i++) + arguments.add((Term) (source.getArgument(i)).clone()); + } + + public Function(String name, ArrayList<Term> arguments) { + this(name, FunctionDefinition.TYPE_USUAL); + this.arguments = arguments; + } + + public Function(String name, Term term2) { + this(name, FunctionDefinition.TYPE_PREFIX); + this.arguments = new ArrayList<Term>(1); + arguments.add(term2); + } + + public Function(Term term1, String name) { + this(name, FunctionDefinition.TYPE_POSTFIX); + this.arguments = new ArrayList<Term>(1); + arguments.add(term1); + } + + public Function(Term term1, String name, Term term2) { + this(name, FunctionDefinition.TYPE_INFIX); + this.arguments = new ArrayList<Term>(2); + arguments.add(term1); + arguments.add(term2); + } + + public Function(FunctionDefinition functionDefinition, ArrayList<Term> arguments) { + this(functionDefinition.getName(), functionDefinition.getType(), arguments); + } + + @Override + public Object clone() { + return new Function(this); + } + + public String getName() { + return name; + } + + public int getArity() { + return arguments.size(); + } + + public int getType() { + return type; + } + + public Term getArgument(int index) { + return (Term) arguments.get(index); + } + + public void setArgument(int index, Term term) { + arguments.set(index, term); + } + + @Override + public boolean isGround() { + for (int i = 0; i < arguments.size(); i++) { + if (!getArgument(i).isGround()) + return false; + } + return true; + } + + @Override + public String toString() { + StringBuffer ret = new StringBuffer("F" + FunctionDefinition.TYPE_NAMES[type] + "[" + name + + "/" + getArity() + "("); + for (int i = 0; i < arguments.size(); i++) { + ret.append(arguments.get(i).toString()); + if (i + 1 < arguments.size()) + ret.append(", "); + } + ret.append(")]"); + return ret.toString(); + } + + @Override + public String toPLString() { + if ((type == FunctionDefinition.TYPE_PREFIX) && (getArity() == 1)) { + return name + ((Term) arguments.get(0)).toPLString(); + } else if ((type == FunctionDefinition.TYPE_POSTFIX) && (getArity() == 1)) { + return ((Term) arguments.get(0)).toPLString() + name; + } else if ((type == FunctionDefinition.TYPE_POSTFIX) && (getArity() == 2)) { + return ((Term) arguments.get(0)).toPLString() + name + + ((Term) arguments.get(1)).toPLString(); + } else { + StringBuffer ret = new StringBuffer(name + "("); + for (int i = 0; i < arguments.size(); i++) { + ret.append(((Term) arguments.get(i)).toPLString()); + if (i + 1 < arguments.size()) + ret.append(", "); + } + ret.append(")"); + return ret.toString(); + } + } + + @Override + public Term getInstance(Variable variable, Term term) { + ArrayList<Term> newArgs = new ArrayList<Term>(arguments.size()); + for (int i = 0; i < arguments.size(); i++) { + Term argument = (Term) arguments.get(i); + newArgs.add(argument.getInstance(variable, term)); + } + return new Function(name, this.type, newArgs); + } + + @Override + public boolean equals(Object obj) { + + if (obj == null) + return false; + + Function f; + + try { + f = (Function) obj; + } catch (ClassCastException cce) { + return false; + } + + if (!name.equals(f.name)) + return false; + if (type != f.type) + return false; + + if (arguments == null) + return f.arguments == null; + else + return arguments.equals(f.arguments); + } + + @Override + public int hashCode() { + return name.hashCode() * (type + 1); + } + +} \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/prolog/FunctionDefinition.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/FunctionDefinition.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/FunctionDefinition.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,86 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +/** + * + * @author Sebastian Bader + * + */ +public class FunctionDefinition { + public static int TYPE_USUAL = 0; + public static int TYPE_INFIX = 1; + public static int TYPE_POSTFIX = 2; + public static int TYPE_PREFIX = 3; + + public static String[] TYPE_NAMES = new String[]{"usual", "infix", "postfix", "prefix"}; + + private String name; + private int arity; + private int type; + + public FunctionDefinition(String name, int arity, int type) { + super(); + this.name = name; + this.arity = arity; + } + + public FunctionDefinition(Function function) { + this(function.getName(), function.getArity(), function.getType()); + } + + public int getArity() { + return arity; + } + public String getName() { + return name; + } + public int getType() { + return type; + } + + @Override + public int hashCode() { + return name.hashCode() * (arity + 1); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) + return false; + try { + FunctionDefinition fd = (FunctionDefinition) obj; + if (fd.getArity() != getArity()) + return false; + if (!fd.getName().equals(getName())) + return false; + if (fd.getType() != getType()) + return false; + } catch (ClassCastException cce) { + return false; + } + return true; + } + + @Override + public String toString() { + return name+TYPE_NAMES[type]+"/"+arity; + } +} Added: trunk/src/dl-learner/org/dllearner/prolog/List.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/List.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/List.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,122 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +import java.util.ArrayList; + + +/** + * + * @author Sebastian Bader + * + */ +public class List extends Term { + private Term head; + private List tail; + + public List() { + head = null; + tail = null; + } + + public List(Term head, List tail) { + this.head = head; + this.tail = tail; + if (tail == null) + this.tail = new List(); + } + + public static List compose(ArrayList<Term> content) { + if (content.isEmpty()) { + return new List(); + } else { + Term head = (Term) content.remove(0); + List body = compose(content); + return new List(head, body); + } + } + + @Override + public boolean isGround() { + if (!head.isGround()) + return false; + return tail.isGround(); + } + + + @Override + public String toString() { + return "L["+((head != null)?head.toString()+"|"+tail:"")+"]"; + } + + @Override + public String toPLString() { + return "["+((head != null)?head.toPLString()+"|"+tail.toPLString():"")+"]"; + } + + @Override + public Term getInstance(Variable variable, Term term) { + if (head != null) { + Term newhead = head.getInstance(variable, term); + List newtail = (List) tail.getInstance(variable, term); + return new List(newhead, newtail); + } + return new List(null, null); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) + return false; + + List list; + try { + list = (List) obj; + } catch (ClassCastException cce) { + return false; + } + + if (head == null) { + if (list.head != null) + return false; + } else { + if (!head.equals(list.head)) + return false; + } + + if (tail == null) { + return (list.tail == null); + } else { + return tail.equals(list.tail); + } + } + + @Override + public int hashCode() { + if (head == null) + return 0; + return head.hashCode(); + } + + @Override + public Object clone() { + return new List((Term) head.clone(), (List) tail.clone()); + } +} \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/prolog/Literal.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/Literal.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/Literal.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,86 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + + + +/** + * + * @author Sebastian Bader + * + */ +public class Literal { + private Atom atom; + private boolean positive; + + public Literal(Atom atom, boolean state) { + this.atom = atom; + this.positive = state; + } + + public Atom getAtom() { + return atom; + } + + public boolean isPositive() { + return positive; + } + + public boolean isGround() { + return atom.isGround(); + } + + public Literal getInstance(Variable variable, Term term) { + return new Literal(atom.getInstance(variable, term), positive); + } + + @Override + public String toString() { + return (positive?"+":"-")+atom.toString(); + } + + public String toPLString() { + return (positive?"":"not ")+atom.toPLString(); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) + return false; + + Literal l; + + try { + l = (Literal) obj; + } catch (ClassCastException cce) { + return false; + } + + if (positive != l.positive) + return false; + + return atom.equals(l.atom); + } + + @Override + public int hashCode() { + return atom.hashCode() * (positive?1:2); + } +} Added: trunk/src/dl-learner/org/dllearner/prolog/Number.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/Number.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/Number.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,92 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + + +/** + * + * @author Sebastian Bader + * + */ +public class Number extends Constant { + private double value; + + public Number(String src) { + value = Double.parseDouble(src); + } + + public Number(double value) { + this.value = value; + } + + public int getIntValue() { + return (int) value; + } + public double getDoubleValue() { + return value; + } + + @Override + public boolean isGround() { + return true; + } + + @Override + public String toString() { + return "C["+toPLString()+"]"; + } + @Override + public String toPLString() { + if (((double)((int)value)) == value) + return ""+(int) value; + return ""+value; + } + + + @Override + public Term getInstance(Variable variable, Term term) { + return new Number(value); + } + + @Override + public int hashCode() { + return (int) value; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) + return false; + + Number number; + try { + number = (Number) obj; + } catch (ClassCastException cce) { + return false; + } + + return value == number.value; + } + + @Override + public Object clone() { + return new Number(value); + } +} \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/prolog/PredicateDefinition.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/PredicateDefinition.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/PredicateDefinition.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,75 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +/** + * + * @author Sebastian Bader + * + */ +public class PredicateDefinition { + private String name; + private int arity; + + public PredicateDefinition(String name, int arity) { + super(); + this.name = name; + this.arity = arity; + } + + public PredicateDefinition(Atom atom) { + this(atom.getName(), atom.getArity()); + } + + public int getArity() { + return arity; + } + + public String getName() { + return name; + } + + @Override + public int hashCode() { + return name.hashCode() * (arity + 1); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) + return false; + try { + PredicateDefinition pd = (PredicateDefinition) obj; + if (pd.getArity() != getArity()) + return false; + if (!pd.getName().equals(getName())) + return false; + } catch (ClassCastException cce) { + return false; + } + return true; + } + + @Override + public String toString() { + return name + "/" + arity; + } + +} Added: trunk/src/dl-learner/org/dllearner/prolog/Program.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/Program.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/Program.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,79 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +import java.util.ArrayList; + +/** + * + * @author Sebastian Bader + * + */ +public class Program { + private ArrayList<Clause> clauses; + + public Program() { + clauses = new ArrayList<Clause>(); + } + + public void addClause(Clause clause) { + clauses.add(clause); + } + + public ArrayList<Clause> getClauses() { + return clauses; + } + + public boolean isGround() { + for (int c = 0; c < clauses.size(); c++) { + Clause clause = (Clause) clauses.get(c); + if (!clause.isGround()) + return false; + } + + return true; + } + + @Override + public String toString() { + StringBuffer ret = new StringBuffer(); + + for (int i = 0; i < clauses.size(); i++) { + ret.append(clauses.get(i)); + if (i + 1 < clauses.size()) + ret.append(" "); + } + + return ret.toString(); + } + + public String toPLString() { + StringBuffer ret = new StringBuffer(); + + for (int i = 0; i < clauses.size(); i++) { + ret.append(((Clause) clauses.get(i)).toPLString()); + if (i + 1 < clauses.size()) + ret.append("\n"); + } + + return ret.toString(); + } + +} Added: trunk/src/dl-learner/org/dllearner/prolog/PrologConstant.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/PrologConstant.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/PrologConstant.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,76 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + + +/** + * + * @author Sebastian Bader + * + */ +public class PrologConstant extends Constant { + private String name; + + public PrologConstant(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean isGround() { + return true; + } + + @Override + public String toString() { + return "C["+name+"]"; + } + @Override + public String toPLString() { + return name; + } + + @Override + public Term getInstance(Variable variable, Term term) { + return new PrologConstant(name); + } + + @Override + public boolean equals(Object obj) { + return name.equals(obj); + } + + @Override + public int hashCode() { + return name.hashCode(); + } + + @Override + public Object clone() { + return new PrologConstant(name); + } +} \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/prolog/StringConstant.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/StringConstant.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/StringConstant.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,72 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +/** + * + * @author Sebastian Bader + * + */ +public class StringConstant extends Constant { + private String string; + + public StringConstant(String src) { + string = src; + } + + public String getString() { + return string; + } + + @Override + public boolean isGround() { + return true; + } + + @Override + public String toString() { + return "C[" + string + "]"; + } + + @Override + public String toPLString() { + return string; + } + + @Override + public Term getInstance(Variable variable, Term term) { + return new StringConstant(string); + } + + @Override + public boolean equals(Object obj) { + return string.equals(obj); + } + + @Override + public int hashCode() { + return string.hashCode(); + } + + @Override + public Object clone() { + return new StringConstant(string); + } +} \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/prolog/Term.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/Term.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/Term.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,60 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +/** + * + * @author Sebastian Bader + * + */ +public abstract class Term implements Cloneable { + + /** + * + * @return Returns true iff this term is ground + */ + public abstract boolean isGround(); + + /** + * + * @param variable + * Substitution variable. + * @param term + * A term. + * @return Returns a new instance of this term, where the variable is + * replaced by the term. + */ + public abstract Term getInstance(Variable variable, Term term); + + @Override + public abstract boolean equals(Object obj); + + @Override + public abstract int hashCode(); + + @Override + public abstract Object clone(); + + @Override + public abstract String toString(); + + public abstract String toPLString(); + +} Added: trunk/src/dl-learner/org/dllearner/prolog/Variable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/Variable.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/Variable.java 2008-02-08 08:57:28 UTC (rev 526) @@ -0,0 +1,89 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.prolog; + +/** + * + * @author Sebastian Bader + * + */ +public class Variable extends Term { + private String name; + + public Variable(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean isGround() { + return false; + } + + @Override + public String toString() { + return "V[" + name + "]"; + } + + @Override + public String toPLString() { + return name; + } + + @Override + public Term getInstance(Variable variable, Term term) { + if (this.equals(variable)) { + return term; + } + return this; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) + return false; + + Variable v; + try { + v = (Variable) obj; + } catch (ClassCastException cce) { + return false; + } + + return name.equals(v.name); + } + + @Override + public int hashCode() { + return name.hashCode(); + } + + @Override + public Object clone() { + return new Variable(name); + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 20:37:22
|
Revision: 525 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=525&view=rev Author: sknappe Date: 2008-02-07 12:37:13 -0800 (Thu, 07 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 20:33:47 UTC (rev 524) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 20:37:13 UTC (rev 525) @@ -93,7 +93,7 @@ // give the link to the corresponding Wikipedia article if(isset($triples['http://xmlns.com/foaf/0.1/page'])) - $content .= '<p><img src="images/wikipedia_favicon.png" alt"Wikipedia" /> <a href="'.$triples['http://xmlns.com/foaf/0.1/page'][0].'">view Wikipedia article</a>, '; + $content .= '<p><img src="'.$_GET['path'].'images/wikipedia_favicon.png" alt"Wikipedia" /> <a href="'.$triples['http://xmlns.com/foaf/0.1/page'][0].'">view Wikipedia article</a>, '; $content .= '<a href="'.$subject.'">view DBpedia resource description</a></p>'; // display a list of classes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 20:33:53
|
Revision: 524 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=524&view=rev Author: sknappe Date: 2008-02-07 12:33:47 -0800 (Thu, 07 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/index.php Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-02-07 20:08:25 UTC (rev 523) +++ trunk/src/dbpedia-navigator/index.php 2008-02-07 20:33:47 UTC (rev 524) @@ -105,13 +105,13 @@ <div id="rightSidebar"> <div class="box"> - <div class="boxtitlewithbutton" id="positivesboxtitle">search relevant <img src="images/remove.png" onclick="xajax_clearPositives()" /> </div> + <div class="boxtitlewithbutton" id="positivesboxtitle">search relevant <img src="<?php print $path;?>images/remove.png" onclick="xajax_clearPositives()" /> </div> <div class="boxcontent" id="Positives"> </div> <!-- boxcontent --> </div> <!-- box --> <div class="box"> - <div class="boxtitlewithbutton" id="negativesboxtitle">not relevant <img src="images/remove.png" onclick="xajax_clearNegatives()" /> </div> + <div class="boxtitlewithbutton" id="negativesboxtitle">not relevant <img src="<?php print $path;?>images/remove.png" onclick="xajax_clearNegatives()" /> </div> <div class="boxcontent" id="Negatives"> </div> <!-- boxcontent --> </div> <!-- box --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 20:08:27
|
Revision: 523 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=523&view=rev Author: sknappe Date: 2008-02-07 12:08:25 -0800 (Thu, 07 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/htaccess.dist Modified: trunk/src/dbpedia-navigator/htaccess.dist =================================================================== --- trunk/src/dbpedia-navigator/htaccess.dist 2008-02-07 19:15:54 UTC (rev 522) +++ trunk/src/dbpedia-navigator/htaccess.dist 2008-02-07 20:08:25 UTC (rev 523) @@ -5,4 +5,5 @@ # Rule Fuer die Module RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^([^/]+)/([^/]+)$ index.php?$1=$2&path=../ \ No newline at end of file +RewriteRule ^([^/]+)/([^/]+)$ index.php?$1=$2&path=../ +RewriteRule !\.(js|ico|gif|jpg|png|css|php)$ index.php \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-07 19:16:04
|
Revision: 522 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=522&view=rev Author: jenslehmann Date: 2008-02-07 11:15:54 -0800 (Thu, 07 Feb 2008) Log Message: ----------- - added lymphography data set (generously donated by Sebastian H.) - small bug fix in cross validation Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/reasoning/FastRetrieval.java trunk/src/dl-learner/org/dllearner/utilities/CrossValidation.java Added Paths: ----------- trunk/examples/lymphography/ trunk/examples/lymphography/lymphography.owl trunk/examples/lymphography/lymphography_Class1.conf trunk/examples/lymphography/lymphography_Class2.conf trunk/examples/lymphography/lymphography_Class3.conf trunk/examples/lymphography/lymphography_Class4.conf Added: trunk/examples/lymphography/lymphography.owl =================================================================== --- trunk/examples/lymphography/lymphography.owl (rev 0) +++ trunk/examples/lymphography/lymphography.owl 2008-02-07 19:15:54 UTC (rev 522) @@ -0,0 +1,2497 @@ @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 19:14:12
|
Revision: 521 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=521&view=rev Author: sknappe Date: 2008-02-07 11:14:09 -0800 (Thu, 07 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/htaccess.dist Modified: trunk/src/dbpedia-navigator/htaccess.dist =================================================================== --- trunk/src/dbpedia-navigator/htaccess.dist 2008-02-07 19:12:48 UTC (rev 520) +++ trunk/src/dbpedia-navigator/htaccess.dist 2008-02-07 19:14:09 UTC (rev 521) @@ -5,5 +5,4 @@ # Rule Fuer die Module RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^([^/]+)/([^/]+)$ index.php?$1=$2&path=../ -RewriteRule ^(.*)\.(js|ico|gif|jpg|png|css|php)$ index.php \ No newline at end of file +RewriteRule ^([^/]+)/([^/]+)$ index.php?$1=$2&path=../ \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 19:12:50
|
Revision: 520 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=520&view=rev Author: sknappe Date: 2008-02-07 11:12:48 -0800 (Thu, 07 Feb 2008) Log Message: ----------- changed htaccess a bit Modified Paths: -------------- trunk/src/dbpedia-navigator/htaccess.dist Removed Paths: ------------- trunk/src/dbpedia-navigator/.htaccess-dist Deleted: trunk/src/dbpedia-navigator/.htaccess-dist =================================================================== --- trunk/src/dbpedia-navigator/.htaccess-dist 2008-02-07 19:06:40 UTC (rev 519) +++ trunk/src/dbpedia-navigator/.htaccess-dist 2008-02-07 19:12:48 UTC (rev 520) @@ -1,8 +0,0 @@ -RewriteEngine On -Options +FollowSymlinks -RewriteBase /dbpedia-navigator/ - -# Rule Fuer die Module -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^([^/]+)/([^/]+)$ index.php?$1=$2&path=../ \ No newline at end of file Modified: trunk/src/dbpedia-navigator/htaccess.dist =================================================================== --- trunk/src/dbpedia-navigator/htaccess.dist 2008-02-07 19:06:40 UTC (rev 519) +++ trunk/src/dbpedia-navigator/htaccess.dist 2008-02-07 19:12:48 UTC (rev 520) @@ -4,4 +4,6 @@ # Rule Fuer die Module RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule ^(.*)$ index.php?resource=$1 \ No newline at end of file +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^([^/]+)/([^/]+)$ index.php?$1=$2&path=../ +RewriteRule ^(.*)\.(js|ico|gif|jpg|png|css|php)$ index.php \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 19:06:46
|
Revision: 519 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=519&view=rev Author: sknappe Date: 2008-02-07 11:06:40 -0800 (Thu, 07 Feb 2008) Log Message: ----------- now it is possible to look for dbpedia-navigator/resource/Leipzig for example Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax.php trunk/src/dbpedia-navigator/ajaxfunctions.php trunk/src/dbpedia-navigator/index.php Added Paths: ----------- trunk/src/dbpedia-navigator/.htaccess-dist Copied: trunk/src/dbpedia-navigator/.htaccess-dist (from rev 512, trunk/src/dbpedia-navigator/.htaccess) =================================================================== --- trunk/src/dbpedia-navigator/.htaccess-dist (rev 0) +++ trunk/src/dbpedia-navigator/.htaccess-dist 2008-02-07 19:06:40 UTC (rev 519) @@ -0,0 +1,8 @@ +RewriteEngine On +Options +FollowSymlinks +RewriteBase /dbpedia-navigator/ + +# Rule Fuer die Module +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^([^/]+)/([^/]+)$ index.php?$1=$2&path=../ \ No newline at end of file Modified: trunk/src/dbpedia-navigator/ajax.php =================================================================== --- trunk/src/dbpedia-navigator/ajax.php 2008-02-07 18:52:41 UTC (rev 518) +++ trunk/src/dbpedia-navigator/ajax.php 2008-02-07 19:06:40 UTC (rev 519) @@ -1,8 +1,10 @@ <?php require_once ("xajax/xajax_core/xajax.inc.php"); $sid = session_id(); +if (isset($_GET['path'])) $path=$_GET['path']; +else $path=""; -$xajax = new xajax("ajaxfunctions.php?sid=$sid"); +$xajax = new xajax($path."ajaxfunctions.php?sid=$sid&path=".$path); $xajax->configureMany(array('debug'=>true)); $xajax->register(XAJAX_FUNCTION, 'getsubjects', array( @@ -25,7 +27,6 @@ $xajax->registerFunction('toNegative'); $xajax->registerFunction('clearPositives'); $xajax->registerFunction('clearNegatives'); -$xajax->registerFunction('showInterests'); $xajax->registerFunction('removePosInterest'); $xajax->registerFunction('removeNegInterest'); $xajax->registerFunction('stopServerCall'); Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 18:52:41 UTC (rev 518) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 19:06:40 UTC (rev 519) @@ -180,11 +180,11 @@ //add Positives and Negatives to Interests $posInterests=""; if (isset($_SESSION['positive'])) foreach($_SESSION['positive'] as $pos){ - $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"images/remove.png\" alt=\"Delete\"/></a><br/>"; + $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"".$_GET['path']."images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; } $negInterests=""; if (isset($_SESSION['negative'])) foreach($_SESSION['negative'] as $neg){ - $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"images/remove.png\" alt=\"Delete\"/></a><br/>"; + $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"".$_GET['path']."images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; } $objResponse->assign("articlecontent", "innerHTML", $content); @@ -212,8 +212,19 @@ $_SESSION['positive']=$array; } + //add Positives and Negatives to Interests + $posInterests=""; + if (isset($_SESSION['positive'])) foreach($_SESSION['positive'] as $pos){ + $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"".$_GET['path']."images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; + } + $negInterests=""; + if (isset($_SESSION['negative'])) foreach($_SESSION['negative'] as $neg){ + $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"".$_GET['path']."images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; + } + $objResponse = new xajaxResponse(); - $objResponse->call('xajax_showInterests'); + $objResponse->assign('Positives','innerHTML',$posInterests); + $objResponse->assign('Negatives','innerHTML',$negInterests); return $objResponse; } @@ -233,8 +244,19 @@ $_SESSION['negative']=$array; } + //add Positives and Negatives to Interests + $posInterests=""; + if (isset($_SESSION['positive'])) foreach($_SESSION['positive'] as $pos){ + $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"".$_GET['path']."images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; + } + $negInterests=""; + if (isset($_SESSION['negative'])) foreach($_SESSION['negative'] as $neg){ + $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"".$_GET['path']."images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; + } + $objResponse = new xajaxResponse(); - $objResponse->call('xajax_showInterests'); + $objResponse->assign('Positives','innerHTML',$posInterests); + $objResponse->assign('Negatives','innerHTML',$negInterests); return $objResponse; } @@ -377,6 +399,7 @@ function setRunning($id,$running) { + if(!is_dir("temp")) mkdir("temp"); $file=fopen("./temp/".$id.".temp","w"); fwrite($file, $running); fclose($file); Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-02-07 18:52:41 UTC (rev 518) +++ trunk/src/dbpedia-navigator/index.php 2008-02-07 19:06:40 UTC (rev 519) @@ -10,6 +10,9 @@ $ids=$sc->getIDs(); $_SESSION['id']=$ids[0]; $_SESSION['ksID']=$ids[1]; + +if (isset($_GET['path'])) $path=$_GET['path']; +else $path=""; // debugging code // echo '<pre>'; @@ -28,8 +31,8 @@ <head> <title>DBpedia Navigator</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> - <link rel="stylesheet" href="default.css"/> - <?php $xajax->printJavascript('xajax/'); ?> + <link rel="stylesheet" href="<?php print $path;?>default.css"/> + <?php $xajax->printJavascript($path.'xajax/'); ?> <script type="text/javascript"> showLoading = function() { xajax.$('Loading').style.display='inline'; @@ -39,10 +42,10 @@ }; </script> </head> - <body <?php if (isset($_GET['resource'])) print "onLoad=\"xajax_getarticle('".$_GET['resource']."',-1);return false;\">";unset($_GET['resource']);?>> + <body <?php if (isset($_GET['resource'])) print "onLoad=\"xajax_getarticle('".$_GET['resource']."',-1);return false;\"";unset($_GET['resource']);?>> <!-- <h1>DBpedia Navigator</h1> --> -<div><table border="0" width="100%"><tr><td width="35%"><img src="images/dbpedia_navigator.png" alt="DBpedia Navigator" style="padding:5px" /></td><td width="50%"><span id="conceptlink"></span></td><td width="15%"><span id="Loading" style="display:none">Server Call... <img src="images/remove.png" onclick="xajax_stopServerCall();return false;" /></span></td></tr></table></div> +<div><table border="0" width="100%"><tr><td width="35%"><img src="<?php print $path;?>images/dbpedia_navigator.png" alt="DBpedia Navigator" style="padding:5px" /></td><td width="50%"><span id="conceptlink"></span></td><td width="15%"><span id="Loading" style="display:none">Server Call... <img src="<?php print $path;?>images/remove.png" onclick="xajax_stopServerCall();return false;" /></span></td></tr></table></div> <div id="layer" style="display:none"> <div id="layerContent" style="display:none"></div> </div> @@ -77,8 +80,8 @@ ... and implemented by <a href="http://jens-lehmann.org">Jens Lehmann</a> and Sebastian Knappe at the <a href="http:/aksw.org">AKSW</a> research group (University of Leipzig).</p> - <a href="http://www.w3.org/2004/OWL/"><img src="images/sw-owl-green.png" alt="OWL logo" /></a> - <a href="http://www.w3.org/2001/sw/DataAccess/"><img src="images/sw-sparql-green.png" alt="SPARQL logo"/></a> + <a href="http://www.w3.org/2004/OWL/"><img src="<?php print $path;?>images/sw-owl-green.png" alt="OWL logo" /></a> + <a href="http://www.w3.org/2001/sw/DataAccess/"><img src="<?php print $path;?>images/sw-sparql-green.png" alt="SPARQL logo"/></a> </div> <input type="button" value="Learn" class="button" onclick="xajax_learnConcept();return false;" /> @@ -132,12 +135,12 @@ $uri = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; echo '<div><a href="http://validator.w3.org/check?uri='.$uri.'"'; - echo '><img src="images/valid-xhtml10.png" alt="valid XHTML 1.0" /></a>'."\n"; + echo '><img src="'.$path.'images/valid-xhtml10.png" alt="valid XHTML 1.0" /></a>'."\n"; echo '<a href="http://jigsaw.w3.org/css-validator/validator?uri='.$uri.'"'; - echo '><img src="images/valid-css.png" alt="valid CSS" /></a></div>'."\n"; + echo '><img src="'.$path.'images/valid-css.png" alt="valid CSS" /></a></div>'."\n"; ?> </div> - <p><a href='rebuild.php'>rebuild [restart session and redownload WSDL file (for debugging)]</a></p> + <p><a href='<?php print $path;?>rebuild.php'>rebuild [restart session and redownload WSDL file (for debugging)]</a></p> </div> <div id="todo"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-07 18:52:48
|
Revision: 518 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=518&view=rev Author: jenslehmann Date: 2008-02-07 10:52:41 -0800 (Thu, 07 Feb 2008) Log Message: ----------- removed unused config folder Added Paths: ----------- trunk/examples/sparql/config.owl Removed Paths: ------------- trunk/config/ Copied: trunk/examples/sparql/config.owl (from rev 515, trunk/config/config.owl) =================================================================== --- trunk/examples/sparql/config.owl (rev 0) +++ trunk/examples/sparql/config.owl 2008-02-07 18:52:41 UTC (rev 518) @@ -0,0 +1,172 @@ +<?xml version="1.0"?> +<!DOCTYPE rdf:RDF [ + <!ENTITY config "http://www.extraction.org/config#"> + <!ENTITY owl "http://www.w3.org/2002/07/owl#"> + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#"> + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#"> +]> +<rdf:RDF xml:base="http://www.extraction.org/config" xmlns:config="http://www.extraction.org/config#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> + <!-- Ontology Information --> + <owl:Ontology rdf:about=""> + <owl:versionInfo xml:lang="en">version 0.1</owl:versionInfo> + </owl:Ontology> + <!-- Classes --> + <owl:Class rdf:about="#Configuration"/> + <owl:Class rdf:about="#FilterSet"/> + <owl:Class rdf:about="#GETParameter"/> + <owl:Class rdf:about="#ObjectFilterSet"> + <rdfs:subClassOf rdf:resource="#FilterSet"/> + </owl:Class> + <owl:Class rdf:about="#PredicateFilterSet"> + <rdfs:subClassOf rdf:resource="#FilterSet"/> + </owl:Class> + <owl:Class rdf:about="#SparqlEndpoint"/> + <owl:Class rdf:about="#TypedQuery"/> + <!-- Annotation Properties --> + <owl:AnnotationProperty rdf:about="&rdfs;comment"/> + <owl:AnnotationProperty rdf:about="&owl;versionInfo"/> + <!-- Datatype Properties --> + <owl:DatatypeProperty rdf:about="#filtersURI"> + <rdfs:domain rdf:resource="#ObjectFilterSet"/> + <rdfs:domain rdf:resource="#PredicateFilterSet"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:about="#hasAfterGET"> + <rdfs:domain rdf:resource="#SparqlEndpoint"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:about="#hasHost"> + <rdfs:domain rdf:resource="#SparqlEndpoint"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:about="#hasMode"> + <rdfs:domain rdf:resource="#TypedQuery"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:about="#hasParameterContent"> + <rdfs:domain rdf:resource="#GETParameter"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:about="#hasParameterName"> + <rdfs:domain rdf:resource="#GETParameter"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:about="#hasPort"> + <rdfs:domain rdf:resource="#SparqlEndpoint"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:about="#hasQueryParameter"> + <rdfs:domain rdf:resource="#SparqlEndpoint"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:about="#hasRecursionDepth"> + <rdfs:domain rdf:resource="#Configuration"/> + </owl:DatatypeProperty> + <owl:DatatypeProperty rdf:about="#usesLiterals"> + <rdfs:domain rdf:resource="#TypedQuery"/> + </owl:DatatypeProperty> + <!-- Object Properties --> + <owl:ObjectProperty rdf:about="#hasGETParameter"> + <rdfs:domain rdf:resource="#SparqlEndpoint"/> + <rdfs:range rdf:resource="#GETParameter"/> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#hasObjectFilterSet"> + <rdfs:domain rdf:resource="#TypedQuery"/> + <rdfs:range rdf:resource="#ObjectFilterSet"/> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#hasPredicateFilterSet"> + <rdfs:domain rdf:resource="#TypedQuery"/> + <rdfs:range rdf:resource="#PredicateFilterSet"/> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#hasSparqlEndpoint"> + <rdfs:domain rdf:resource="#Configuration"/> + <rdfs:range rdf:resource="#SparqlEndpoint"/> + </owl:ObjectProperty> + <owl:ObjectProperty rdf:about="#hasTypedQuery"> + <rdfs:domain rdf:resource="#Configuration"/> + <rdfs:range rdf:resource="#TypedQuery"/> + </owl:ObjectProperty> + <!-- Instances --> + <config:SparqlEndpoint rdf:about="#dbpediaEndpoint"> + <config:hasAfterGET rdf:datatype="&xsd;string">/sparql</config:hasAfterGET> + <config:hasGETParameter rdf:resource="#defaultgraphuri"/> + <config:hasGETParameter rdf:resource="#format"/> + <config:hasHost rdf:datatype="&xsd;string">dbpedia.openlinksw.com</config:hasHost> + <config:hasPort rdf:datatype="&xsd;string">80</config:hasPort> + <config:hasQueryParameter rdf:datatype="&xsd;string">query</config:hasQueryParameter> + <config:hasURL>dbpedia.openlinksw.com:80/sparql</config:hasURL> + </config:SparqlEndpoint> + <config:ObjectFilterSet rdf:about="#dbpediaGeneralObjectFilter"> + <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/resource/Category:Articles_</config:filtersURI> + <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/resource/Category:Wikipedia_</config:filtersURI> + <config:filtersURI rdf:datatype="&xsd;string">http://upload.wikimedia.org/wikipedia/commons</config:filtersURI> + <config:filtersURI rdf:datatype="&xsd;string">http://upload.wikimedia.org/wikipedia</config:filtersURI> + <config:filtersURI rdf:datatype="&xsd;string">http://www.geonames.org</config:filtersURI> + <config:filtersURI rdf:datatype="&xsd;string">http://www.w3.org/2006/03/wn/wn20/instances/synset</config:filtersURI> + <config:filtersURI rdf:datatype="&xsd;string">http://www4.wiwiss.fu-berlin.de/flickrwrappr</config:filtersURI> + </config:ObjectFilterSet> + <config:PredicateFilterSet rdf:about="#dbpediaGeneralPredicateFilter"> + <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/property/reference</config:filtersURI> + <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/property/website</config:filtersURI> + <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/property/wikipage-</config:filtersURI> + </config:PredicateFilterSet> + <config:TypedQuery rdf:about="#dbpediaYago"> + <config:hasMode rdf:datatype="&xsd;string">forbid</config:hasMode> + <config:hasObjectFilterSet rdf:resource="#dbpediaGeneralObjectFilter"/> + <config:hasObjectFilterSet rdf:resource="#foafObjectFilter"/> + <config:hasObjectFilterSet rdf:resource="#yagoObjectFilter"/> + <config:hasPredicateFilterSet rdf:resource="#dbpediaGeneralPredicateFilter"/> + <config:hasPredicateFilterSet rdf:resource="#foafPredicateFilter"/> + <config:hasPredicateFilterSet rdf:resource="#sameAsFilter"/> + <config:hasPredicateFilterSet rdf:resource="#yagoPredicateFilter"/> + <config:usesLiterals rdf:datatype="&xsd;string">false</config:usesLiterals> + </config:TypedQuery> + <config:Configuration rdf:about="#dbpediatest" rdfs:comment="for first test"> + <config:hasRecursionDepth rdf:datatype="&xsd;string">2</config:hasRecursionDepth> + <config:hasSparqlEndpoint rdf:resource="#dbpediaEndpoint"/> + <config:hasTypedQuery rdf:resource="#dbpediaYago"/> + </config:Configuration> + <config:GETParameter rdf:about="#defaultgraphuri"> + <config:hasParameterContent rdf:datatype="&xsd;string">http://dbpedia.org</config:hasParameterContent> + <config:hasParameterName rdf:datatype="&xsd;string">default-graph-uri</config:hasParameterName> + </config:GETParameter> + <config:ObjectFilterSet rdf:about="#foafObjectFilter"> + <config:filtersURI rdf:datatype="&xsd;string">http://xmlns.com/foaf/0.1/</config:filtersURI> + </config:ObjectFilterSet> + <config:PredicateFilterSet rdf:about="#foafPredicateFilter"> + <config:filtersURI rdf:datatype="&xsd;string">http://xmlns.com/foaf/0.1/</config:filtersURI> + </config:PredicateFilterSet> + <config:GETParameter rdf:about="#format"> + <config:hasParameterContent rdf:datatype="&xsd;string">application/sparql-results.xml</config:hasParameterContent> + <config:hasParameterName rdf:datatype="&xsd;string">format</config:hasParameterName> + </config:GETParameter> + <config:Configuration rdf:about="#localjoseki"> + <config:hasRecursionDepth rdf:datatype="&xsd;string">2</config:hasRecursionDepth> + <config:hasSparqlEndpoint rdf:resource="#localjosekiendpoint"/> + <config:hasTypedQuery rdf:resource="#localjosekitypedquery"/> + </config:Configuration> + <config:SparqlEndpoint rdf:about="#localjosekiendpoint"> + <config:hasAfterGET rdf:datatype="&xsd;string">/books</config:hasAfterGET> + <config:hasHost rdf:datatype="http://www.w3.org/2001/XMLSchema#string">localhost</config:hasHost> + <config:hasPort rdf:datatype="&xsd;string">2020</config:hasPort> + <config:hasQueryParameter rdf:datatype="&xsd;string">query</config:hasQueryParameter> + <config:hasURL>localhost:2020/books</config:hasURL> + </config:SparqlEndpoint> + <config:TypedQuery rdf:about="#localjosekitypedquery"> + <config:hasMode rdf:datatype="&xsd;string">forbid</config:hasMode> + <config:hasObjectFilterSet rdf:resource="#dbpediaGeneralObjectFilter"/> + <config:hasPredicateFilterSet rdf:resource="#dbpediaGeneralPredicateFilter"/> + <config:usesLiterals rdf:datatype="&xsd;string">false</config:usesLiterals> + </config:TypedQuery> + <config:PredicateFilterSet rdf:about="#sameAsFilter"> + <config:filtersURI rdf:datatype="&xsd;string">http://www.w3.org/2002/07/owl#sameAs</config:filtersURI> + </config:PredicateFilterSet> + <config:ObjectFilterSet rdf:about="#yagoObjectFilter"> + <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/resource/Category:Articles_</config:filtersURI> + <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/resource/Category:Wikipedia_</config:filtersURI> + </config:ObjectFilterSet> + <config:PredicateFilterSet rdf:about="#yagoPredicateFilter"> + <config:filtersURI rdf:datatype="&xsd;string">http://www.w3.org/2004/02/skos/core</config:filtersURI> + </config:PredicateFilterSet> + <rdf:Description rdf:about="#hasURL"> + <rdf:type> + <rdf:Description rdf:about="http://www.w3.org/2002/07/owl#DatatypeProperty"/> + </rdf:type> + <rdfs:domain> + <rdf:Description rdf:about="#SparqlEndpoint"/> + </rdfs:domain> + </rdf:Description> +</rdf:RDF> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-07 18:51:26
|
Revision: 517 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=517&view=rev Author: jenslehmann Date: 2008-02-07 10:51:19 -0800 (Thu, 07 Feb 2008) Log Message: ----------- forgot to remove temp folder Removed Paths: ------------- trunk/src/dbpedia-navigator/temp/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-07 18:33:36
|
Revision: 516 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=516&view=rev Author: jenslehmann Date: 2008-02-07 10:33:32 -0800 (Thu, 07 Feb 2008) Log Message: ----------- - added .htaccess and temp folder to svn ignore - .htaccess is not in htaccess.dist and has to be configured locally (in particular the rewrite base) Added Paths: ----------- trunk/src/dbpedia-navigator/htaccess.dist Removed Paths: ------------- trunk/src/dbpedia-navigator/.htaccess Property Changed: ---------------- trunk/src/dbpedia-navigator/ Property changes on: trunk/src/dbpedia-navigator ___________________________________________________________________ Name: svn:ignore - main.wsdl def0.xsd def1.xsd + temp .htaccess main.wsdl def0.xsd def1.xsd Deleted: trunk/src/dbpedia-navigator/.htaccess =================================================================== --- trunk/src/dbpedia-navigator/.htaccess 2008-02-07 17:36:33 UTC (rev 515) +++ trunk/src/dbpedia-navigator/.htaccess 2008-02-07 18:33:32 UTC (rev 516) @@ -1,7 +0,0 @@ -RewriteEngine On -Options +FollowSymlinks -RewriteBase /dbpedia-navigator/ - -# Rule Fuer die Module -RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule ^(.*)$ index.php?resource=$1 \ No newline at end of file Copied: trunk/src/dbpedia-navigator/htaccess.dist (from rev 515, trunk/src/dbpedia-navigator/.htaccess) =================================================================== --- trunk/src/dbpedia-navigator/htaccess.dist (rev 0) +++ trunk/src/dbpedia-navigator/htaccess.dist 2008-02-07 18:33:32 UTC (rev 516) @@ -0,0 +1,7 @@ +RewriteEngine On +Options +FollowSymlinks +RewriteBase /dbpedia-navigator/ + +# Rule Fuer die Module +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^(.*)$ index.php?resource=$1 \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-07 17:36:37
|
Revision: 515 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=515&view=rev Author: jenslehmann Date: 2008-02-07 09:36:33 -0800 (Thu, 07 Feb 2008) Log Message: ----------- started better example and noise handling Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2008-02-07 17:11:15 UTC (rev 514) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2008-02-07 17:36:33 UTC (rev 515) @@ -39,9 +39,9 @@ */ public class ExampleBasedNode { - // TODO: add example based variables here - @SuppressWarnings({"unused"}) + // example based variables here private Set<Individual> coveredPositives; + private Set<Individual> coveredNegatives; // TOP ist einfach das TOP-Konzept, also das einzige welches nicht evaluiert wird public enum QualityEvaluationMethod { TOP, REASONER, TOO_WEAK_LIST, OVERLY_GENERAL_LIST }; @@ -190,5 +190,21 @@ public void setQualityEvaluationMethod(QualityEvaluationMethod qualityEvaluationMethod) { this.qualityEvaluationMethod = qualityEvaluationMethod; } + + public Set<Individual> getCoveredPositives() { + return coveredPositives; + } + + public void setCoveredPositives(Set<Individual> coveredPositives) { + this.coveredPositives = coveredPositives; + } + + public Set<Individual> getCoveredNegatives() { + return coveredNegatives; + } + + public void setCoveredNegatives(Set<Individual> coveredNegatives) { + this.coveredNegatives = coveredNegatives; + } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-02-07 17:11:15 UTC (rev 514) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-02-07 17:36:33 UTC (rev 515) @@ -250,6 +250,7 @@ Helper.checkConcepts(rs, allowedConcepts); usedConcepts = allowedConcepts; } else if(ignoredConcepts != null) { + System.out.println(ignoredConcepts); usedConcepts = Helper.computeConceptsUsingIgnoreList(rs, ignoredConcepts); } else { usedConcepts = Helper.computeConcepts(rs); @@ -292,7 +293,7 @@ algHeuristic, // usedConcepts, // usedRoles, - noisePercentage, + noisePercentage/(double)100, writeSearchTree, replaceSearchTree, searchTreeFile, Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-02-07 17:11:15 UTC (rev 514) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-02-07 17:36:33 UTC (rev 515) @@ -21,6 +21,7 @@ import java.io.File; import java.text.DecimalFormat; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -28,6 +29,7 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.dllearner.algorithms.refinement.RefinementOperator; import org.dllearner.algorithms.refinement.RhoDown; @@ -35,6 +37,7 @@ import org.dllearner.core.ReasoningService; import org.dllearner.core.Score; import org.dllearner.core.dl.Concept; +import org.dllearner.core.dl.Individual; import org.dllearner.core.dl.MultiConjunction; import org.dllearner.core.dl.MultiDisjunction; import org.dllearner.core.dl.Top; @@ -56,6 +59,15 @@ * can be misclassified (everything above is considered a too weak * concept wrt. the noise percentage). * + * TODO: Solve subsumption problems. It is easy to implement approximate fast + * instance checks. However, subsumption is difficult to optimise. It should by + * analysed whether it is reasonable to perform instance comparisions instead + * of subsumption checks, e.g. a concept is only included in the search tree + * when it covers strictly less examples than its parent. Note, that this does + * not mean that concepts not bearing an advantage in classification are thrown + * away. They are just handled like improper refinements. [TODO: How does this + * differ from not checking subsumption at all?] + * * @author Jens Lehmann * */ @@ -68,8 +80,15 @@ private ReasoningService rs; private PosNegLP learningProblem; private PosOnlyDefinitionLP posOnlyLearningProblem; - private boolean posOnly = false; + private boolean posOnly = false; + private int nrOfExamples; + private int nrOfPositiveExamples; + private int nrOfNegativeExamples; + // noise regulates how many positives can be misclassified and when the algorithm terminates + private double noise = 0.0; + private int allowedMisclassifications = 0; + // search tree options private boolean writeSearchTree; private File searchTreeFile; @@ -153,7 +172,7 @@ ExampleBasedHeuristic heuristic, // Set<AtomicConcept> allowedConcepts, // Set<AtomicRole> allowedRoles, - double noisePercentage, + double noise, boolean writeSearchTree, boolean replaceSearchTree, File searchTreeFile, @@ -162,39 +181,56 @@ boolean useShortConceptConstruction ) { if(learningProblem instanceof PosNegLP) { - this.learningProblem = (PosNegLP) learningProblem; + PosNegLP lp = (PosNegLP) learningProblem; + this.learningProblem = lp; posOnly = false; + nrOfPositiveExamples = lp.getPositiveExamples().size(); + nrOfNegativeExamples = lp.getNegativeExamples().size(); } else if(learningProblem instanceof PosOnlyDefinitionLP) { - this.posOnlyLearningProblem = (PosOnlyDefinitionLP) learningProblem; + PosOnlyDefinitionLP lp = (PosOnlyDefinitionLP) learningProblem; + this.posOnlyLearningProblem = lp; posOnly = true; + nrOfPositiveExamples = lp.getPositiveExamples().size(); + nrOfNegativeExamples = lp.getPseudoNegatives().size(); } + nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; this.rs = rs; this.operator = (RhoDown) operator; // initialise candidate set with heuristic as ordering candidates = new TreeSet<ExampleBasedNode>(heuristic); - // this.noisePercentage ... + this.noise = noise; this.writeSearchTree = writeSearchTree; this.replaceSearchTree = replaceSearchTree; this.searchTreeFile = searchTreeFile; this.useTooWeakList = useTooWeakList; this.useOverlyGeneralList = useOverlyGeneralList; this.useShortConceptConstruction = useShortConceptConstruction; + + logger.setLevel(Level.DEBUG); } public void start() { + + // calculate quality threshold required for a solution + allowedMisclassifications = (int) Math.round(noise * nrOfExamples); + // start search with most general concept Top top = new Top(); ExampleBasedNode topNode = new ExampleBasedNode(top); // top covers all negatives int coveredNegativeExamples = getNumberOfNegatives(); topNode.setCoveredNegativeExamples(coveredNegativeExamples); + topNode.setCoveredPositives(learningProblem.getPositiveExamples()); + topNode.setCoveredNegatives(learningProblem.getNegativeExamples()); candidates.add(topNode); candidatesStable.add(topNode); + // note that TOP may already be a solution - solutionFound = (coveredNegativeExamples == 0); - solutions = new LinkedList<Concept>(); - if(solutionFound) - solutions.add(top); + ExampleBasedNode bestNode = topNode; +// solutionFound = (coveredNegativeExamples == 0); +// solutions = new LinkedList<Concept>(); +// if(solutionFound) +// solutions.add(top); int loop = 0; @@ -202,14 +238,17 @@ while(!solutionFound && !stop) { - // besten Knoten nach Heuristik auswählen - ExampleBasedNode bestNode = candidates.last(); - // besten Knoten erweitern - // newCandidates = new TreeSet<Node>(nodeComparator); + printStatistics(false); + + // chose best node according to heuristics + bestNode = candidates.last(); + // extend best node newCandidates.clear(); + // TODO: why is the best node tempoariliy removed from the candidates set? candidates.remove(bestNode); extendNodeProper(bestNode, bestNode.getHorizontalExpansion()+1); candidates.add(bestNode); + // newCandidates has been filled during node expansion candidates.addAll(newCandidates); candidatesStable.addAll(newCandidates); @@ -373,7 +412,7 @@ propernessTestsAvoidedByTooWeakList++; conceptTestsTooWeakList++; propernessDetected = true; - tooWeakList.add(refinement); + // tooWeakList.add(refinement); // Knoten wird direkt erzeugt (es ist buganfällig zwei Plätze // zu haben, an denen Knoten erzeugt werden, aber es erscheint @@ -436,40 +475,12 @@ // schon existiert if(nonRedundant) { - // Knoten erzeugen + // newly created node ExampleBasedNode newNode = new ExampleBasedNode(refinement); // die -1 ist wichtig, da sonst keine gleich langen Refinements // für den neuen Knoten erlaubt wären z.B. person => male newNode.setHorizontalExpansion(refinement.getLength()-1); - - // hier finden Tests statt, die Retrieval-Anfrage vermeiden sollen - /* - Integer n = evaluationCache.get(concept); - // Konzept gefunden - if(n!=null) { - // Knoten erzeugen - Node newNode = new Node(refinement); - newNode.setHorizontalExpansion(refinement.getLength()-1); - node.addChild(newNode); - - // too weak - if(n==-1) { - newNode.setTooWeak(true); - // nicht too weak - } else { - // feststellen, ob proper => geht so nicht - // gleiche covered negatives bedeutet nicht improper - boolean proper = (n==node.getCoveredNegativeExamples()); - newNode.setCoveredNegativeExamples(n); - - } - // Konzept nicht gefunden => muss ausgewertet werden - } else { - toEvaluateConcepts.add(refinement); - } - */ - boolean qualityKnown = false; int quality = -2; @@ -487,9 +498,59 @@ if(!qualityKnown) { long propCalcReasoningStart2 = System.nanoTime(); conceptTestsReasoner++; - quality = coveredNegativesOrTooWeak(refinement); + + // quality = coveredNegativesOrTooWeak(refinement); + + // determine individuals which have not been covered yet (more efficient than full retrieval) + Set<Individual> coveredPositives = node.getCoveredPositives(); + Set<Individual> newlyCoveredPositives = new HashSet<Individual>(); + + // calculate how many pos. examples are not covered by the + // parent node of the refinement + int misclassifications = nrOfPositiveExamples - coveredPositives.size(); + + // iterate through all covered examples (examples which are not + // covered do not need to be tested, because they remain uncovered) + // TODO: DIG will be slow if we send each reasoner request individually + // (however if we send everything in one request, too many instance checks + // are performed => rely on fast instance checker [still to implement]) + for(Individual i : coveredPositives) { + // TODO: move code to a separate function + if(quality != -1) { + boolean covered = rs.instanceCheck(refinement, i); + if(!covered) + misclassifications++; + else + newlyCoveredPositives.add(i); + + if(misclassifications > allowedMisclassifications) + quality = -1; + + } + } + + Set<Individual> newlyCoveredNegatives = null; + if(quality != -1) { + Set<Individual> coveredNegatives = node.getCoveredNegatives(); + newlyCoveredNegatives = new HashSet<Individual>(); + + for(Individual i : coveredNegatives) { + boolean covered = rs.instanceCheck(refinement, i); + if(covered) + newlyCoveredNegatives.add(i); + } + } + propernessCalcReasoningTimeNs += System.nanoTime() - propCalcReasoningStart2; newNode.setQualityEvaluationMethod(ExampleBasedNode.QualityEvaluationMethod.REASONER); + if(quality != -1) { + // quality is the number of misclassifications (if it is not too weak) + quality = (nrOfPositiveExamples - newlyCoveredPositives.size()) + + newlyCoveredNegatives.size(); + newNode.setCoveredNegatives(newlyCoveredNegatives); + newNode.setCoveredPositives(newlyCoveredPositives); + } + } if(quality == -1) { @@ -520,66 +581,6 @@ } - /* - Iterator<Concept> it = refinements.iterator(); - while(it.hasNext()) { - Concept refinement = it.next(); - if(refinement.getLength()>node.getHorizontalExpansion()) { - // Test auf properness - long propCalcReasoningStart = System.nanoTime(); - boolean isProper = !learningProblem.getReasoningService().subsumes(refinement, concept); - propernessCalcReasoningTimeNs += System.nanoTime() - propCalcReasoningStart; - - if(isProper) { - long redundancyCheckTimeNsStart = System.nanoTime(); - boolean nonRedundant = properRefinements.add(refinement); - redundancyCheckTimeNs += System.nanoTime() - redundancyCheckTimeNsStart; - - if(!nonRedundant) - redundantConcepts++; - - // es wird nur ein neuer Knoten erzeugt, falls das Konzept nicht - // schon existiert - if(nonRedundant) { - - // Knoten erzeugen - Node newNode = new Node(refinement); - // die -1 ist wichtig, da sonst keine gleich langen Refinements - // für den neuen Knoten erlaubt wären z.B. person => male - newNode.setHorizontalExpansion(refinement.getLength()-1); - node.addChild(newNode); - - // Qualität des Knotens auswerten - long propCalcReasoningStart2 = System.nanoTime(); - int quality = learningProblem.coveredNegativeExamplesOrTooWeak(refinement); - propernessCalcReasoningTimeNs += System.nanoTime() - propCalcReasoningStart2; - - if(quality == -1) { - newNode.setTooWeak(true); - } else { - // Lösung gefunden - if(quality == 0) { - solutionFound = true; - solutions.add(refinement); - } - - newNode.setCoveredNegativeExamples(quality); - newCandidates.add(newNode); - - // System.out.print("."); - } - } - - // jedes proper Refinement wird gelöscht - it.remove(); - - } - } - } - */ - - - // es sind jetzt noch alle Konzepte übrig, die improper refinements sind // auf jedem dieser Konzepte wird die Funktion erneut aufgerufen, da sich // proper refinements ergeben könnten @@ -662,6 +663,7 @@ + conceptTestsTooWeakList + "/" + conceptTestsOverlyGeneralList + "/" + redundantConcepts); } + @SuppressWarnings({"unused"}) private int coveredNegativesOrTooWeak(Concept concept) { if(posOnly) return posOnlyLearningProblem.coveredPseudoNegativeExamplesOrTooWeak(concept); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 17:11:30
|
Revision: 514 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=514&view=rev Author: sknappe Date: 2008-02-07 09:11:15 -0800 (Thu, 07 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 16:21:07 UTC (rev 513) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 17:11:15 UTC (rev 514) @@ -177,13 +177,22 @@ } } + //add Positives and Negatives to Interests + $posInterests=""; + if (isset($_SESSION['positive'])) foreach($_SESSION['positive'] as $pos){ + $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"images/remove.png\" alt=\"Delete\"/></a><br/>"; + } + $negInterests=""; + if (isset($_SESSION['negative'])) foreach($_SESSION['negative'] as $neg){ + $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"images/remove.png\" alt=\"Delete\"/></a><br/>"; + } $objResponse->assign("articlecontent", "innerHTML", $content); $objResponse->assign("ArticleTitle","innerHTML",$artTitle); $objResponse->assign("lastarticles","innerHTML",$lastArticles); $objResponse->assign("searchcontent", "innerHTML", $searchResult); - - $objResponse->call('xajax_showInterests'); + $objResponse->assign('Positives','innerHTML',$posInterests); + $objResponse->assign('Negatives','innerHTML',$negInterests); return $objResponse; } @@ -253,27 +262,6 @@ return $objResponse; } -function showInterests() -{ - $sid = $_GET['sid']; - session_id($sid); - session_start(); - //add Positives and Negatives to Interests - $posInterests=""; - if (isset($_SESSION['positive'])) foreach($_SESSION['positive'] as $pos){ - $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"images/remove.png\" alt=\"Minus\"/></a><br/>"; - } - $negInterests=""; - if (isset($_SESSION['negative'])) foreach($_SESSION['negative'] as $neg){ - $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"images/remove.png\" alt=\"Minus\"/></a><br/>"; - } - - $objResponse=new xajaxResponse(); - $objResponse->assign('Positives','innerHTML',$posInterests); - $objResponse->assign('Negatives','innerHTML',$negInterests); - return $objResponse; -} - function removePosInterest($subject) { $sid = $_GET['sid']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 16:21:25
|
Revision: 513 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=513&view=rev Author: sknappe Date: 2008-02-07 08:21:07 -0800 (Thu, 07 Feb 2008) Log Message: ----------- .temp Files go now in a temp folder Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php trunk/src/dbpedia-navigator/ajaxfunctions.php Added Paths: ----------- trunk/src/dbpedia-navigator/temp/ Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-07 16:14:08 UTC (rev 512) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-07 16:21:07 UTC (rev 513) @@ -87,7 +87,7 @@ $i++; //look, if algorithm was stopped - $file=fopen($this->id.".temp","r"); + $file=fopen("./temp/".$this->id.".temp","r"); $run=fgets($file); fclose($file); if ($run=="false"){ @@ -138,7 +138,7 @@ $seconds = $i * $sleeptime; $i++; //look, if algorithm was stopped - $file=fopen($this->id.".temp","r"); + $file=fopen("./temp/".$this->id.".temp","r"); $run=fgets($file); fclose($file); if ($run=="false"){ Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 16:14:08 UTC (rev 512) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 16:21:07 UTC (rev 513) @@ -389,7 +389,7 @@ function setRunning($id,$running) { - $file=fopen($id.".temp","w"); + $file=fopen("./temp/".$id.".temp","w"); fwrite($file, $running); fclose($file); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 16:14:17
|
Revision: 512 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=512&view=rev Author: sknappe Date: 2008-02-07 08:14:08 -0800 (Thu, 07 Feb 2008) Log Message: ----------- added basic REST component Modified Paths: -------------- trunk/src/dbpedia-navigator/index.php Added Paths: ----------- trunk/src/dbpedia-navigator/.htaccess Added: trunk/src/dbpedia-navigator/.htaccess =================================================================== --- trunk/src/dbpedia-navigator/.htaccess (rev 0) +++ trunk/src/dbpedia-navigator/.htaccess 2008-02-07 16:14:08 UTC (rev 512) @@ -0,0 +1,7 @@ +RewriteEngine On +Options +FollowSymlinks +RewriteBase /dbpedia-navigator/ + +# Rule Fuer die Module +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^(.*)$ index.php?resource=$1 \ No newline at end of file Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-02-07 11:43:21 UTC (rev 511) +++ trunk/src/dbpedia-navigator/index.php 2008-02-07 16:14:08 UTC (rev 512) @@ -39,7 +39,7 @@ }; </script> </head> - <body> + <body <?php if (isset($_GET['resource'])) print "onLoad=\"xajax_getarticle('".$_GET['resource']."',-1);return false;\">";unset($_GET['resource']);?>> <!-- <h1>DBpedia Navigator</h1> --> <div><table border="0" width="100%"><tr><td width="35%"><img src="images/dbpedia_navigator.png" alt="DBpedia Navigator" style="padding:5px" /></td><td width="50%"><span id="conceptlink"></span></td><td width="15%"><span id="Loading" style="display:none">Server Call... <img src="images/remove.png" onclick="xajax_stopServerCall();return false;" /></span></td></tr></table></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 11:43:24
|
Revision: 511 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=511&view=rev Author: sknappe Date: 2008-02-07 03:43:21 -0800 (Thu, 07 Feb 2008) Log Message: ----------- fixed a bug for redirects Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 10:40:10 UTC (rev 510) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 11:43:21 UTC (rev 511) @@ -125,7 +125,10 @@ //BUILD ARTICLE TITLE $artTitle=$triples['http://www.w3.org/2000/01/rdf-schema#label'][0]; + + //Restart the Session session_start(); + //store article in session, to navigate between last 5 articles quickly $contentArray=array('content' => $content,'subject' => $artTitle); if (!isset($_SESSION['nextArticle'])){ @@ -139,12 +142,16 @@ //Add Positives to Session if (!isset($_SESSION['positive'])){ - $array=array("http://dbpedia.org/resource/".str_replace(" ","_",$subject) => "http://dbpedia.org/resource/".str_replace(" ","_",$subject)); + if (isset($triples['http://dbpedia.org/property/redirect'])){ + $array=array($triples['http://dbpedia.org/property/redirect'][0] => $triples['http://dbpedia.org/property/redirect'][0]); + } + else $array=array("http://dbpedia.org/resource/".str_replace(" ","_",$subject) => "http://dbpedia.org/resource/".str_replace(" ","_",$subject)); $_SESSION['positive']=$array; } else{ $array=$_SESSION['positive']; - $array["http://dbpedia.org/resource/".str_replace(" ","_",$subject)]="http://dbpedia.org/resource/".str_replace(" ","_",$subject); + if (isset($triples['http://dbpedia.org/property/redirect'])) $array[$triples['http://dbpedia.org/property/redirect'][0]] = $triples['http://dbpedia.org/property/redirect'][0]; + else $array["http://dbpedia.org/resource/".str_replace(" ","_",$subject)]="http://dbpedia.org/resource/".str_replace(" ","_",$subject); $_SESSION['positive']=$array; } @@ -254,11 +261,11 @@ //add Positives and Negatives to Interests $posInterests=""; if (isset($_SESSION['positive'])) foreach($_SESSION['positive'] as $pos){ - $posInterests=$posInterests.substr (strrchr ($pos, "/"), 1)." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"images/remove.png\" alt=\"Minus\"/></a><br/>"; + $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"images/remove.png\" alt=\"Minus\"/></a><br/>"; } $negInterests=""; if (isset($_SESSION['negative'])) foreach($_SESSION['negative'] as $neg){ - $negInterests=$negInterests.substr (strrchr ($neg, "/"), 1)." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"images/remove.png\" alt=\"Minus\"/></a><br/>"; + $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"images/remove.png\" alt=\"Minus\"/></a><br/>"; } $objResponse=new xajaxResponse(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 10:40:29
|
Revision: 510 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=510&view=rev Author: sknappe Date: 2008-02-07 02:40:10 -0800 (Thu, 07 Feb 2008) Log Message: ----------- Redirects are now properly handled Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-07 09:55:12 UTC (rev 509) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-07 10:40:10 UTC (rev 510) @@ -104,7 +104,7 @@ function getTriples($label) { $query="SELECT ?pred ?obj ". - "WHERE {<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> ?pred ?obj}"; + "WHERE {{<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> ?pred ?obj}UNION{<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> <http://dbpedia.org/property/redirect> ?Conc.?Conc ?pred ?obj}}"; $result=$this->getSparqlResult($query); if (!isset($result->item)) throw new Exception("Your query brought no result. The Label-Search is started."); $ret=array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ton...@us...> - 2008-02-07 09:55:17
|
Revision: 509 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=509&view=rev Author: tonytacker Date: 2008-02-07 01:55:12 -0800 (Thu, 07 Feb 2008) Log Message: ----------- add autoInit() for init all 4 tabs in one method (in config.java) Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/gui/Config.java trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java trunk/src/dl-learner/org/dllearner/gui/OptionPanel.java trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java trunk/src/dl-learner/org/dllearner/gui/RunPanel.java trunk/src/dl-learner/org/dllearner/gui/ThreadRun.java trunk/src/dl-learner/org/dllearner/gui/WidgetPanelString.java Modified: trunk/src/dl-learner/org/dllearner/gui/Config.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/Config.java 2008-02-07 09:40:38 UTC (rev 508) +++ trunk/src/dl-learner/org/dllearner/gui/Config.java 2008-02-07 09:55:12 UTC (rev 509) @@ -50,8 +50,7 @@ private LearningProblem lp; private LearningAlgorithm la; private boolean[] isInit = new boolean[4]; - - + protected ComponentManager getComponentManager() { return cm; } @@ -125,64 +124,60 @@ } /** - * KnowledgeSource.init has run? - * return true, if it was + * KnowledgeSource.init has run? return true, if it was */ protected boolean isInitKnowledgeSource() { return isInit[0]; } - + /** * set true if you run KnowwledgeSource.init */ protected void setInitKnowledgeSource(Boolean is) { isInit[0] = is; - for (int i=1; i<4; i++) + for (int i = 1; i < 4; i++) isInit[i] = false; } /** - * Reasoner.init has run? - * return true, if it was + * Reasoner.init has run? return true, if it was */ protected boolean isInitReasoner() { return isInit[1]; } - + /** * set true if you run Reasoner.init */ protected void setInitReasoner(Boolean is) { isInit[1] = is; - for (int i=2; i<4; i++) + for (int i = 2; i < 4; i++) isInit[i] = false; } /** - * LearningProblem.init has run? - * return true, if it was + * LearningProblem.init has run? return true, if it was */ protected boolean isInitLearningProblem() { return isInit[2]; } - + /** * set true if you run LearningProblem.init */ protected void setInitLearningProblem(Boolean is) { isInit[2] = is; - for (int i=3; i<4; i++) + for (int i = 3; i < 4; i++) isInit[i] = false; } /** - * LearningAlgorithm.init() has run? - * return true, if it was + * LearningAlgorithm.init() has run? return true, if it was */ - protected boolean isLearningAlgorithm() { + protected boolean isInitLearningAlgorithm() { return isInit[3]; } - + /** * set true if you run LearningAlgorithm.init */ @@ -190,4 +185,43 @@ isInit[3] = is; } + protected void autoInit() { + // Knowledge Source + if (!this.isInitKnowledgeSource() && this.getKnowledgeSource() != null + && this.getURI() != null) { + this.getKnowledgeSource().init(); + this.setInitKnowledgeSource(true); + System.out.println("init KnowledgeSource"); + } + // Reasoner + if (!this.isInitReasoner() && this.getKnowledgeSource() != null + && this.getReasoner() != null) { + this.getReasoner().init(); + System.out.println("init Reasoner"); + // set ReasoningService + this.setReasoningService(this.getComponentManager() + .reasoningService(this.getReasoner())); + System.out.println("init ReasoningService"); + this.setInitReasoner(true); + } + // Learning Problem + if (!this.isInitLearningProblem() && this.getReasoner() != null + && this.getLearningProblem() != null) { + this.getComponentManager().applyConfigEntry( + this.getLearningProblem(), "negativeExamples", + this.getNegExampleSet()); + this.getLearningProblem().init(); + this.setInitLearningProblem(true); + System.out.println("init LearningProblem"); + } + // Learning Algorithm + if (!this.isInitLearningAlgorithm() + && this.getLearningProblem() != null + && this.getLearningAlgorithm() != null) { + this.getLearningAlgorithm().init(); + System.out.println("init LearningAlgorithm"); + } + + } + } Modified: trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-02-07 09:40:38 UTC (rev 508) +++ trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-02-07 09:55:12 UTC (rev 509) @@ -37,7 +37,7 @@ private static final long serialVersionUID = -7678275020058043937L; - private JButton initButton, getInstancesButton; + private JButton initButton; private String[] kbBoxItems = {}; private JComboBox cb = new JComboBox(kbBoxItems); private JPanel choosePanel = new JPanel(); @@ -53,10 +53,9 @@ this.config = config; sources = config.getComponentManager().getKnowledgeSources(); - getInstancesButton = new JButton("Get Instances"); - getInstancesButton.addActionListener(this); initButton = new JButton("Init KnowledgeSource"); initButton.addActionListener(this); + initButton.setEnabled(false); // add to comboBox for (int i = 0; i < sources.size(); i++) { @@ -66,7 +65,6 @@ cb.addActionListener(this); choosePanel.add(cb); - choosePanel.add(getInstancesButton); optionPanel = new OptionPanel(config, config.getKnowledgeSource(), sources.get(choosenClassIndex)); initPanel.add(initButton); @@ -76,23 +74,27 @@ add(initPanel, BorderLayout.PAGE_END); choosenClassIndex = cb.getSelectedIndex(); + setSource(); } public void actionPerformed(ActionEvent e) { // read selected KnowledgeSourceClass - choosenClassIndex = cb.getSelectedIndex(); + // choosenClassIndex = cb.getSelectedIndex(); + if (choosenClassIndex != cb.getSelectedIndex()) { + choosenClassIndex = cb.getSelectedIndex(); + config.setURI(null); // default null + config.setInitKnowledgeSource(false); + setSource(); + } - if (e.getSource() == getInstancesButton) - getInstances(); - - if (e.getSource() == initButton && config.getURI() != null) + if (e.getSource() == initButton) init(); } /** * after this, you can change widgets */ - public void getInstances() { + public void setSource() { config.setKnowledgeSource(config.getComponentManager().knowledgeSource( sources.get(choosenClassIndex))); updateOptionPanel(); @@ -102,11 +104,12 @@ * after this, next tab can be used */ public void init() { - config.getKnowledgeSource().init(); - config.setInitKnowledgeSource(true); - System.out.println("init KnowledgeSource with \n" - + sources.get(choosenClassIndex) + " and \n" + config.getURI() - + "\n"); +/* if (config.getKnowledgeSource() != null && config.getURI() != null) { + config.getKnowledgeSource().init(); + config.setInitKnowledgeSource(true); + System.out.println("init KnowledgeSource"); + } +*/ config.autoInit(); } /** Modified: trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-07 09:40:38 UTC (rev 508) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-07 09:55:12 UTC (rev 509) @@ -42,7 +42,7 @@ private JPanel choosePanel = new JPanel(); private OptionPanel optionPanel; private JPanel initPanel = new JPanel(); - private JButton initButton, getInstancesButton; + private JButton initButton, autoInitButton; private String[] cbItems = {}; private JComboBox cb = new JComboBox(cbItems); private int choosenClassIndex; @@ -56,8 +56,9 @@ initButton = new JButton("Init LearingAlgorithm"); initButton.addActionListener(this); initPanel.add(initButton); - getInstancesButton = new JButton("Get Instances"); - getInstancesButton.addActionListener(this); + initButton.setEnabled(false); + autoInitButton = new JButton("AutoInit"); + autoInitButton.addActionListener(this); // add into comboBox for (int i = 0; i < learners.size(); i++) { @@ -66,7 +67,7 @@ } choosePanel.add(cb); - choosePanel.add(getInstancesButton); + choosePanel.add(autoInitButton); cb.addActionListener(this); optionPanel = new OptionPanel(config, config.getLearningAlgorithm(), @@ -80,10 +81,15 @@ public void actionPerformed(ActionEvent e) { // read selected Class - choosenClassIndex = cb.getSelectedIndex(); + // choosenClassIndex = cb.getSelectedIndex(); + if (choosenClassIndex != cb.getSelectedIndex()) { + choosenClassIndex = cb.getSelectedIndex(); + config.setInitLearningProblem(false); + setLearningAlgorithm(); + } - if (e.getSource() == getInstancesButton && config.isInitLearningProblem()) - getInstances(); + if (e.getSource() == autoInitButton) + setLearningAlgorithm(); if (e.getSource() == initButton && config.isInitLearningProblem()) init(); @@ -92,8 +98,10 @@ /** * after this, you can change widgets */ - public void getInstances() { - if (config.getLearningProblem() != null + public void setLearningAlgorithm() { + config.autoInit(); + if (config.isInitLearningProblem() + && config.getLearningProblem() != null && config.getReasoningService() != null) { config.setLearningAlgorithm(config.getComponentManager() .learningAlgorithm(learners.get(choosenClassIndex), @@ -107,9 +115,11 @@ * after this, next tab can be used */ public void init() { - config.getLearningAlgorithm().init(); - System.out.println("init LearningAlgorithm"); - + /* + * if (config.isInitLearningProblem()) { + * config.getLearningAlgorithm().init(); System.out.println("init + * LearningAlgorithm"); } + */config.autoInit(); } /** Modified: trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-02-07 09:40:38 UTC (rev 508) +++ trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-02-07 09:55:12 UTC (rev 509) @@ -55,7 +55,7 @@ private JPanel initPanel = new JPanel(); private JLabel posLabel = new JLabel("positive Examples"); private JLabel negLabel = new JLabel("negative Examples"); - private JButton initButton, getInstancesButton; + private JButton initButton, autoInitButton; private int choosenClassIndex; private List<Individual> individuals; private JList posList = new JList(); @@ -73,10 +73,11 @@ initButton = new JButton("Init LearningProblem"); initButton.addActionListener(this); initPanel.add(initButton); - getInstancesButton = new JButton("Get Instances"); - getInstancesButton.addActionListener(this); + initButton.setEnabled(false); + autoInitButton = new JButton("AutoInit"); + autoInitButton.addActionListener(this); choosePanel.add(cb); - choosePanel.add(getInstancesButton); + choosePanel.add(autoInitButton); cb.addActionListener(this); // add into comboBox @@ -174,16 +175,24 @@ add(listPanel, BorderLayout.CENTER); add(initPanel, BorderLayout.PAGE_END); + choosenClassIndex = cb.getSelectedIndex(); + setLearningProblem(); } public void actionPerformed(ActionEvent e) { // read selected LearningProblemClass - choosenClassIndex = cb.getSelectedIndex(); + // choosenClassIndex = cb.getSelectedIndex(); + if (choosenClassIndex != cb.getSelectedIndex()) { + choosenClassIndex = cb.getSelectedIndex(); + config.setInitLearningProblem(false); + setLearningProblem(); + } - if (e.getSource() == getInstancesButton && config.isInitReasoner()) - getInstances(); - if (e.getSource() == initButton && config.isInitReasoner()) + if (e.getSource() == autoInitButton) + setLearningProblem(); + + if (e.getSource() == initButton) init(); } @@ -203,37 +212,42 @@ /** * after this, you can change widgets */ - public void getInstances() { - config.setLearningProblem(config.getComponentManager().learningProblem( - problems.get(choosenClassIndex), config.getReasoningService())); - // lists - if (config.getReasoningService() != null) { - // fill lists - Set<Individual> individualsSet = config.getReasoningService() - .getIndividuals(); - individuals = new LinkedList<Individual>(individualsSet); - DefaultListModel listModel = new DefaultListModel(); - for (Individual ind : individuals) { - listModel.addElement(ind); + public void setLearningProblem() { + config.autoInit(); + if (config.isInitReasoner()) { + config.setLearningProblem(config.getComponentManager() + .learningProblem(problems.get(choosenClassIndex), + config.getReasoningService())); + // lists + if (config.getReasoningService() != null) { + // fill lists + Set<Individual> individualsSet = config.getReasoningService() + .getIndividuals(); + individuals = new LinkedList<Individual>(individualsSet); + DefaultListModel listModel = new DefaultListModel(); + for (Individual ind : individuals) { + listModel.addElement(ind); + } + posList.setModel(listModel); + negList.setModel(listModel); } - posList.setModel(listModel); - negList.setModel(listModel); + updateOptionPanel(); } - updateOptionPanel(); } /** * after this, next tab can be used */ public void init() { - - config.getComponentManager().applyConfigEntry( - config.getLearningProblem(), "negativeExamples", - config.getNegExampleSet()); - config.getLearningProblem().init(); - config.setInitLearningProblem(true); - System.out.println("init LearningProblem"); - +/* if (config.isInitReasoner()) { + config.getComponentManager().applyConfigEntry( + config.getLearningProblem(), "negativeExamples", + config.getNegExampleSet()); + config.getLearningProblem().init(); + config.setInitLearningProblem(true); + System.out.println("init LearningProblem"); + } +*/ config.autoInit(); } /** Modified: trunk/src/dl-learner/org/dllearner/gui/OptionPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/OptionPanel.java 2008-02-07 09:40:38 UTC (rev 508) +++ trunk/src/dl-learner/org/dllearner/gui/OptionPanel.java 2008-02-07 09:55:12 UTC (rev 509) @@ -75,6 +75,7 @@ } + /** update this OptionPanel */ public void update(Component component, Class<? extends Component> componentOption) { this.componentOption = componentOption; @@ -82,7 +83,7 @@ showWidgets(); } - /* + /** * Define here what core.config.class is what type of widget. * WidgetPanelDefault is for none defined classes. */ @@ -122,7 +123,7 @@ centerPanel.updateUI(); // update graphic } - /* + /** * Define GridBagConstraints */ private void buildConstraints(GridBagConstraints gbc, int gx, int gy, Modified: trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-02-07 09:40:38 UTC (rev 508) +++ trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-02-07 09:55:12 UTC (rev 509) @@ -43,7 +43,7 @@ private JPanel choosePanel = new JPanel(); private JPanel initPanel = new JPanel(); private OptionPanel optionPanel; - private JButton initButton, getInstancesButton; + private JButton initButton, autoInitButton; private Config config; private String[] cbItems = {}; private JComboBox cb = new JComboBox(cbItems); @@ -58,8 +58,9 @@ initButton = new JButton("Init Reasoner"); initButton.addActionListener(this); initPanel.add(initButton); - getInstancesButton = new JButton("Get Instances"); - getInstancesButton.addActionListener(this); + initButton.setEnabled(false); + autoInitButton = new JButton("AutoInit"); + autoInitButton.addActionListener(this); choosePanel.add(cb); @@ -72,31 +73,38 @@ optionPanel = new OptionPanel(config, config.getReasoner(), reasoners .get(choosenClassIndex)); - choosePanel.add(getInstancesButton); - + choosePanel.add(autoInitButton); cb.addActionListener(this); add(choosePanel, BorderLayout.PAGE_START); add(optionPanel, BorderLayout.CENTER); add(initPanel, BorderLayout.PAGE_END); + choosenClassIndex = cb.getSelectedIndex(); + setReasoner(); } public void actionPerformed(ActionEvent e) { // read selected Class - choosenClassIndex = cb.getSelectedIndex(); + // choosenClassIndex = cb.getSelectedIndex(); + if (choosenClassIndex != cb.getSelectedIndex()) { + choosenClassIndex = cb.getSelectedIndex(); + config.setInitReasoner(false); + setReasoner(); + } - if (e.getSource() == getInstancesButton) - getInstances(); + if (e.getSource() == autoInitButton) + setReasoner(); - if (e.getSource() == initButton && config.getKnowledgeSource() != null) + if (e.getSource() == initButton) init(); } /** * after this, you can change widgets */ - public void getInstances() { + public void setReasoner() { + config.autoInit(); if (config.isInitKnowledgeSource()) { config.setReasoner(config.getComponentManager().reasoner( reasoners.get(choosenClassIndex), @@ -109,13 +117,7 @@ * after this, next tab can be used */ public void init() { - config.getReasoner().init(); - System.out.println("init Reasoner"); - // set ReasoningService - config.setReasoningService(config.getComponentManager() - .reasoningService(config.getReasoner())); - System.out.println("init ReasoningService"); - config.setInitReasoner(true); + config.autoInit(); } /** Modified: trunk/src/dl-learner/org/dllearner/gui/RunPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2008-02-07 09:40:38 UTC (rev 508) +++ trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2008-02-07 09:55:12 UTC (rev 509) @@ -26,7 +26,7 @@ import javax.swing.*; -//import org.dllearner.core.dl.Concept; +// import org.dllearner.core.dl.Concept; /** * OutputPanel @@ -38,13 +38,12 @@ private static final long serialVersionUID = 1643304576470046636L; - private JButton runButton, stopButton; + private JButton runButton, stopButton, testButton; private JTextArea infoArea; private Config config; - + private ThreadRun thread; - RunPanel(Config config) { super(new BorderLayout()); @@ -54,13 +53,17 @@ runButton.addActionListener(this); stopButton = new JButton("Stop"); stopButton.addActionListener(this); - + testButton = new JButton("TEST"); + testButton.addActionListener(this); + infoArea = new JTextArea(20, 50); JScrollPane infoScroll = new JScrollPane(infoArea); JPanel showPanel = new JPanel(); showPanel.add(runButton); showPanel.add(stopButton); + showPanel.add(testButton); + JPanel infoPanel = new JPanel(); infoPanel.add(infoScroll); @@ -70,15 +73,24 @@ public void actionPerformed(ActionEvent e) { if (e.getSource() == runButton && config.getLearningAlgorithm() != null) { + config.autoInit(); thread = new ThreadRun(config); thread.start(); - //Concept solution = config.getLearningAlgorithm().getBestSolution(); - //infoArea.setText(solution.toString()); + // Concept solution = + // config.getLearningAlgorithm().getBestSolution(); + // infoArea.setText(solution.toString()); } - if (e.getSource() == stopButton && config.getLearningAlgorithm() != null) { - //config.getLearningAlgorithm().stop(); + if (e.getSource() == stopButton + && config.getLearningAlgorithm() != null) { + // config.getLearningAlgorithm().stop(); thread.exit(); + } + if (e.getSource() == testButton + && config.getLearningAlgorithm() != null) { + config.getLearningAlgorithm().stop(); + } + } - + } Modified: trunk/src/dl-learner/org/dllearner/gui/ThreadRun.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ThreadRun.java 2008-02-07 09:40:38 UTC (rev 508) +++ trunk/src/dl-learner/org/dllearner/gui/ThreadRun.java 2008-02-07 09:55:12 UTC (rev 509) @@ -43,5 +43,6 @@ public void exit() { if (config.getLearningAlgorithm() != null) config.getLearningAlgorithm().stop(); + System.out.println("stop"); } } Modified: trunk/src/dl-learner/org/dllearner/gui/WidgetPanelString.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/WidgetPanelString.java 2008-02-07 09:40:38 UTC (rev 508) +++ trunk/src/dl-learner/org/dllearner/gui/WidgetPanelString.java 2008-02-07 09:55:12 UTC (rev 509) @@ -57,7 +57,7 @@ private Class<? extends Component> componentOption; private String value; - private JTextField stringField = new JTextField(15); + private JTextField stringField = new JTextField(35); public WidgetPanelString(Config config, Component component, Class<? extends Component> componentOption, @@ -86,9 +86,16 @@ value = fc.getSelectedFile().toString(); stringField.setText(value); config.setURI(value); // save variable + System.out.println("value: " + config.getURI()); } } setEntry(); + // if url and value not "" + // necessary for init knowledge source + if (configOption.getName().equalsIgnoreCase("url") + && !value.equalsIgnoreCase("")) { + config.setURI(value); + } } } @@ -164,10 +171,7 @@ * ActionPerformed */ private Boolean checkForFilename() { - if (configOption.getName().equalsIgnoreCase("filename")) - return true; - else - return false; + return configOption.getName().equalsIgnoreCase("filename"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 09:40:40
|
Revision: 508 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=508&view=rev Author: sknappe Date: 2008-02-07 01:40:38 -0800 (Thu, 07 Feb 2008) Log Message: ----------- the first letter of the search string is now always big Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-06 17:54:26 UTC (rev 507) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 09:40:38 UTC (rev 508) @@ -47,6 +47,9 @@ session_write_close(); setRunning($id,"true"); + //get first Letter of label big + $subject=ucfirst($subject); + //if article is in session, get it out of the session if (isset($articles)){ foreach ($articles as $key => $value) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-06 17:54:28
|
Revision: 507 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=507&view=rev Author: sknappe Date: 2008-02-06 09:54:26 -0800 (Wed, 06 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php trunk/src/dbpedia-navigator/ajaxfunctions.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-06 17:37:47 UTC (rev 506) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-06 17:54:26 UTC (rev 507) @@ -106,7 +106,7 @@ $query="SELECT ?pred ?obj ". "WHERE {<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> ?pred ?obj}"; $result=$this->getSparqlResult($query); - if (!isset($result->item)) throw new Exception("Your query brought no result."); + if (!isset($result->item)) throw new Exception("Your query brought no result. The Label-Search is started."); $ret=array(); foreach ($result->item as $results){ $value=$results->item[1]; Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-06 17:37:47 UTC (rev 506) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-06 17:54:26 UTC (rev 507) @@ -64,6 +64,8 @@ $lastArticles=""; $artTitle=""; + $objResponse = new xajaxResponse(); + //get the article //if $fromCache is -2, no new SearchResults should be processed //if $fromCache is -1, everything is normal @@ -114,8 +116,10 @@ $content .= '<br/><br/><br/><br/><br/><br/>'.get_triple_table($triples); + //BUILD SEARCHRESULT + if ($fromCache==-1) + $searchResult.="<a href=\"\" onclick=\"xajax_getsubjects('".$subject."');return false;\">Show more Results</a>"; - //BUILD ARTICLE TITLE $artTitle=$triples['http://www.w3.org/2000/01/rdf-schema#label'][0]; session_start(); @@ -144,7 +148,8 @@ } catch (Exception $e) { $content=$e->getMessage(); - $artTitle="Fehler"; + $artTitle="No Result"; + $objResponse->call('xajax_getsubjects',$subject); } } else { @@ -154,10 +159,6 @@ $artTitle=$_SESSION['articles'][$fromCache]['subject']; } - //BUILD SEARCHRESULT - if ($fromCache==-1) - $searchResult.="<a href=\"\" onclick=\"xajax_getsubjects('".$subject."');return false;\">Show more Results</a>"; - //Build lastArticles if (isset($_SESSION['articles'])){ foreach ($_SESSION['articles'] as $key => $value) @@ -166,7 +167,7 @@ } } - $objResponse = new xajaxResponse(); + $objResponse->assign("articlecontent", "innerHTML", $content); $objResponse->assign("ArticleTitle","innerHTML",$artTitle); $objResponse->assign("lastarticles","innerHTML",$lastArticles); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-06 17:37:51
|
Revision: 506 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=506&view=rev Author: sknappe Date: 2008-02-06 09:37:47 -0800 (Wed, 06 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-06 17:13:22 UTC (rev 505) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-06 17:37:47 UTC (rev 506) @@ -106,7 +106,7 @@ $query="SELECT ?pred ?obj ". "WHERE {<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> ?pred ?obj}"; $result=$this->getSparqlResult($query); - if (!$result->item) throw new Exception("Your query brought no result."); + if (!isset($result->item)) throw new Exception("Your query brought no result."); $ret=array(); foreach ($result->item as $results){ $value=$results->item[1]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-06 17:13:26
|
Revision: 505 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=505&view=rev Author: sknappe Date: 2008-02-06 09:13:22 -0800 (Wed, 06 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-06 17:04:01 UTC (rev 504) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-06 17:13:22 UTC (rev 505) @@ -41,7 +41,7 @@ $sid = $_GET['sid']; session_id($sid); session_start(); - $articles=$_SESSION['articles']; + if (isset($_SESSION['articles'])) $articles=$_SESSION['articles']; $id=$_SESSION['id']; $ksID=$_SESSION['ksID']; session_write_close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-06 17:04:08
|
Revision: 504 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=504&view=rev Author: jenslehmann Date: 2008-02-06 09:04:01 -0800 (Wed, 06 Feb 2008) Log Message: ----------- updated startup files and classpath entries Modified Paths: -------------- trunk/bin/dllearner trunk/bin/dllearner.bat trunk/bin/quickstart trunk/bin/quickstart.bat trunk/bin/ws trunk/bin/ws.bat trunk/doc/eclipse/classpath.dist trunk/src/dl-learner/org/dllearner/Info.java Modified: trunk/bin/dllearner =================================================================== --- trunk/bin/dllearner 2008-02-06 16:36:56 UTC (rev 503) +++ trunk/bin/dllearner 2008-02-06 17:04:01 UTC (rev 504) @@ -1 +1 @@ -java -cp .:./lib/dig1.1-xmlbeans.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/commons-logging.jar:./lib/jena/concurrent.jar:./lib/jena/icu4j_3_4.jar:./lib/jena/iri.jar:./lib/jena/jena.jar:./lib/jena/xercesImpl.jar:./lib/kaon2.jar:./lib/owlapi/antlr-runtime-3.0.jar:./lib/owlapi/commons-lang-2.2.jar:./lib/owlapi/owlapi-api.jar:./lib/owlapi/owlapi-apibinding.jar:./lib/owlapi/owlapi-change.jar:./lib/owlapi/owlapi-debugging.jar:./lib/owlapi/owlapi-dig1_1.jar:./lib/owlapi/owlapi-functionalparser.jar:./lib/owlapi/owlapi-functionalrenderer.jar:./lib/owlapi/owlapi-impl.jar:./lib/owlapi/owlapi-krssparser.jar:./lib/owlapi/owlapi-mansyntaxparser.jar:./lib/owlapi/owlapi-mansyntaxrenderer.jar:./lib/owlapi/owlapi-metrics.jar:./lib/owlapi/owlapi-oboparser.jar:./lib/owlapi/owlapi-owlxmlparser.jar:./lib/owlapi/owlapi-owlxmlrenderer.jar:./lib/owlapi/owlapi-rdfapi.jar:./lib/owlapi/owlapi-rdfxmlparser.jar:./lib/owlapi/owlapi-rdfxmlrenderer.jar:./lib/owlapi/owlapi-util.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.cli.start $@ \ No newline at end of file +java -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCT++OWLAPI-v1.1.10+.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.1.jar:./lib/jena/concurrent.jar:./lib/jena/icu4j_3_4.jar:./lib/jena/iri.jar:./lib/jena/jena.jar:./lib/jena/json.jar:./lib/jena/xercesImpl.jar:./lib/junit-4.4.jar:./lib/log4j.jar:./lib/owlapi/antlr-runtime-3.0.jar:./lib/owlapi/commons-lang-2.2.jar:./lib/owlapi/owlapi-api.jar:./lib/owlapi/owlapi-apibinding.jar:./lib/owlapi/owlapi-change.jar:./lib/owlapi/owlapi-debugging.jar:./lib/owlapi/owlapi-dig1_1.jar:./lib/owlapi/owlapi-functionalparser.jar:./lib/owlapi/owlapi-functionalrenderer.jar:./lib/owlapi/owlapi-impl.jar:./lib/owlapi/owlapi-krssparser.jar:./lib/owlapi/owlapi-mansyntaxparser.jar:./lib/owlapi/owlapi-mansyntaxrenderer.jar:./lib/owlapi/owlapi-metrics.jar:./lib/owlapi/owlapi-oboparser.jar:./lib/owlapi/owlapi-owlxmlparser.jar:./lib/owlapi/owlapi-owlxmlrenderer.jar:./lib/owlapi/owlapi-rdfapi.jar:./lib/owlapi/owlapi-rdfxmlparser.jar:./lib/owlapi/owlapi-rdfxmlrenderer.jar:./lib/owlapi/owlapi-util.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.cli.start $@ \ No newline at end of file Modified: trunk/bin/dllearner.bat =================================================================== --- trunk/bin/dllearner.bat 2008-02-06 16:36:56 UTC (rev 503) +++ trunk/bin/dllearner.bat 2008-02-06 17:04:01 UTC (rev 504) @@ -1 +1 @@ -java -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\commons-logging.jar;.\lib\jena\concurrent.jar;.\lib\jena\icu4j_3_4.jar;.\lib\jena\iri.jar;.\lib\jena\jena.jar;.\lib\jena\xercesImpl.jar;.\lib\kaon2.jar;.\lib\owlapi\antlr-runtime-3.0.jar;.\lib\owlapi\commons-lang-2.2.jar;.\lib\owlapi\owlapi-api.jar;.\lib\owlapi\owlapi-apibinding.jar;.\lib\owlapi\owlapi-change.jar;.\lib\owlapi\owlapi-debugging.jar;.\lib\owlapi\owlapi-dig1_1.jar;.\lib\owlapi\owlapi-functionalparser.jar;.\lib\owlapi\owlapi-functionalrenderer.jar;.\lib\owlapi\owlapi-impl.jar;.\lib\owlapi\owlapi-krssparser.jar;.\lib\owlapi\owlapi-mansyntaxparser.jar;.\lib\owlapi\owlapi-mansyntaxrenderer.jar;.\lib\owlapi\owlapi-metrics.jar;.\lib\owlapi\owlapi-oboparser.jar;.\lib\owlapi\owlapi-owlxmlparser.jar;.\lib\owlapi\owlapi-owlxmlrenderer.jar;.\lib\owlapi\owlapi-rdfapi.jar;.\lib\owlapi\owlapi-rdfxmlparser.jar;.\lib\owlapi\owlapi-rdfxmlrenderer.jar;.\lib\owlapi\owlapi-util.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.cli.Start %* \ No newline at end of file +java -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCT++OWLAPI-v1.1.10+.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.1.jar;.\lib\jena\concurrent.jar;.\lib\jena\icu4j_3_4.jar;.\lib\jena\iri.jar;.\lib\jena\jena.jar;.\lib\jena\json.jar;.\lib\jena\xercesImpl.jar;.\lib\junit-4.4.jar;.\lib\log4j.jar;.\lib\owlapi\antlr-runtime-3.0.jar;.\lib\owlapi\commons-lang-2.2.jar;.\lib\owlapi\owlapi-api.jar;.\lib\owlapi\owlapi-apibinding.jar;.\lib\owlapi\owlapi-change.jar;.\lib\owlapi\owlapi-debugging.jar;.\lib\owlapi\owlapi-dig1_1.jar;.\lib\owlapi\owlapi-functionalparser.jar;.\lib\owlapi\owlapi-functionalrenderer.jar;.\lib\owlapi\owlapi-impl.jar;.\lib\owlapi\owlapi-krssparser.jar;.\lib\owlapi\owlapi-mansyntaxparser.jar;.\lib\owlapi\owlapi-mansyntaxrenderer.jar;.\lib\owlapi\owlapi-metrics.jar;.\lib\owlapi\owlapi-oboparser.jar;.\lib\owlapi\owlapi-owlxmlparser.jar;.\lib\owlapi\owlapi-owlxmlrenderer.jar;.\lib\owlapi\owlapi-rdfapi.jar;.\lib\owlapi\owlapi-rdfxmlparser.jar;.\lib\owlapi\owlapi-rdfxmlrenderer.jar;.\lib\owlapi\owlapi-util.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.cli.Start %* \ No newline at end of file Modified: trunk/bin/quickstart =================================================================== --- trunk/bin/quickstart 2008-02-06 16:36:56 UTC (rev 503) +++ trunk/bin/quickstart 2008-02-06 17:04:01 UTC (rev 504) @@ -1 +1 @@ -java -cp .:./lib/dig1.1-xmlbeans.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/commons-logging.jar:./lib/jena/concurrent.jar:./lib/jena/icu4j_3_4.jar:./lib/jena/iri.jar:./lib/jena/jena.jar:./lib/jena/xercesImpl.jar:./lib/kaon2.jar:./lib/owlapi/antlr-runtime-3.0.jar:./lib/owlapi/commons-lang-2.2.jar:./lib/owlapi/owlapi-api.jar:./lib/owlapi/owlapi-apibinding.jar:./lib/owlapi/owlapi-change.jar:./lib/owlapi/owlapi-debugging.jar:./lib/owlapi/owlapi-dig1_1.jar:./lib/owlapi/owlapi-functionalparser.jar:./lib/owlapi/owlapi-functionalrenderer.jar:./lib/owlapi/owlapi-impl.jar:./lib/owlapi/owlapi-krssparser.jar:./lib/owlapi/owlapi-mansyntaxparser.jar:./lib/owlapi/owlapi-mansyntaxrenderer.jar:./lib/owlapi/owlapi-metrics.jar:./lib/owlapi/owlapi-oboparser.jar:./lib/owlapi/owlapi-owlxmlparser.jar:./lib/owlapi/owlapi-owlxmlrenderer.jar:./lib/owlapi/owlapi-rdfapi.jar:./lib/owlapi/owlapi-rdfxmlparser.jar:./lib/owlapi/owlapi-rdfxmlrenderer.jar:./lib/owlapi/owlapi-util.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.cli.QuickStart \ No newline at end of file +java -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCT++OWLAPI-v1.1.10+.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.1.jar:./lib/jena/concurrent.jar:./lib/jena/icu4j_3_4.jar:./lib/jena/iri.jar:./lib/jena/jena.jar:./lib/jena/json.jar:./lib/jena/xercesImpl.jar:./lib/junit-4.4.jar:./lib/log4j.jar:./lib/owlapi/antlr-runtime-3.0.jar:./lib/owlapi/commons-lang-2.2.jar:./lib/owlapi/owlapi-api.jar:./lib/owlapi/owlapi-apibinding.jar:./lib/owlapi/owlapi-change.jar:./lib/owlapi/owlapi-debugging.jar:./lib/owlapi/owlapi-dig1_1.jar:./lib/owlapi/owlapi-functionalparser.jar:./lib/owlapi/owlapi-functionalrenderer.jar:./lib/owlapi/owlapi-impl.jar:./lib/owlapi/owlapi-krssparser.jar:./lib/owlapi/owlapi-mansyntaxparser.jar:./lib/owlapi/owlapi-mansyntaxrenderer.jar:./lib/owlapi/owlapi-metrics.jar:./lib/owlapi/owlapi-oboparser.jar:./lib/owlapi/owlapi-owlxmlparser.jar:./lib/owlapi/owlapi-owlxmlrenderer.jar:./lib/owlapi/owlapi-rdfapi.jar:./lib/owlapi/owlapi-rdfxmlparser.jar:./lib/owlapi/owlapi-rdfxmlrenderer.jar:./lib/owlapi/owlapi-util.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.cli.QuickStart \ No newline at end of file Modified: trunk/bin/quickstart.bat =================================================================== --- trunk/bin/quickstart.bat 2008-02-06 16:36:56 UTC (rev 503) +++ trunk/bin/quickstart.bat 2008-02-06 17:04:01 UTC (rev 504) @@ -1 +1 @@ -java -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\commons-logging.jar;.\lib\jena\concurrent.jar;.\lib\jena\icu4j_3_4.jar;.\lib\jena\iri.jar;.\lib\jena\jena.jar;.\lib\jena\xercesImpl.jar;.\lib\kaon2.jar;.\lib\owlapi\antlr-runtime-3.0.jar;.\lib\owlapi\commons-lang-2.2.jar;.\lib\owlapi\owlapi-api.jar;.\lib\owlapi\owlapi-apibinding.jar;.\lib\owlapi\owlapi-change.jar;.\lib\owlapi\owlapi-debugging.jar;.\lib\owlapi\owlapi-dig1_1.jar;.\lib\owlapi\owlapi-functionalparser.jar;.\lib\owlapi\owlapi-functionalrenderer.jar;.\lib\owlapi\owlapi-impl.jar;.\lib\owlapi\owlapi-krssparser.jar;.\lib\owlapi\owlapi-mansyntaxparser.jar;.\lib\owlapi\owlapi-mansyntaxrenderer.jar;.\lib\owlapi\owlapi-metrics.jar;.\lib\owlapi\owlapi-oboparser.jar;.\lib\owlapi\owlapi-owlxmlparser.jar;.\lib\owlapi\owlapi-owlxmlrenderer.jar;.\lib\owlapi\owlapi-rdfapi.jar;.\lib\owlapi\owlapi-rdfxmlparser.jar;.\lib\owlapi\owlapi-rdfxmlrenderer.jar;.\lib\owlapi\owlapi-util.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.cli.QuickStart \ No newline at end of file +java -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCT++OWLAPI-v1.1.10+.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.1.jar;.\lib\jena\concurrent.jar;.\lib\jena\icu4j_3_4.jar;.\lib\jena\iri.jar;.\lib\jena\jena.jar;.\lib\jena\json.jar;.\lib\jena\xercesImpl.jar;.\lib\junit-4.4.jar;.\lib\log4j.jar;.\lib\owlapi\antlr-runtime-3.0.jar;.\lib\owlapi\commons-lang-2.2.jar;.\lib\owlapi\owlapi-api.jar;.\lib\owlapi\owlapi-apibinding.jar;.\lib\owlapi\owlapi-change.jar;.\lib\owlapi\owlapi-debugging.jar;.\lib\owlapi\owlapi-dig1_1.jar;.\lib\owlapi\owlapi-functionalparser.jar;.\lib\owlapi\owlapi-functionalrenderer.jar;.\lib\owlapi\owlapi-impl.jar;.\lib\owlapi\owlapi-krssparser.jar;.\lib\owlapi\owlapi-mansyntaxparser.jar;.\lib\owlapi\owlapi-mansyntaxrenderer.jar;.\lib\owlapi\owlapi-metrics.jar;.\lib\owlapi\owlapi-oboparser.jar;.\lib\owlapi\owlapi-owlxmlparser.jar;.\lib\owlapi\owlapi-owlxmlrenderer.jar;.\lib\owlapi\owlapi-rdfapi.jar;.\lib\owlapi\owlapi-rdfxmlparser.jar;.\lib\owlapi\owlapi-rdfxmlrenderer.jar;.\lib\owlapi\owlapi-util.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.cli.QuickStart \ No newline at end of file Modified: trunk/bin/ws =================================================================== --- trunk/bin/ws 2008-02-06 16:36:56 UTC (rev 503) +++ trunk/bin/ws 2008-02-06 17:04:01 UTC (rev 504) @@ -1 +1 @@ -java -cp .:./lib/dig1.1-xmlbeans.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/commons-logging.jar:./lib/jena/concurrent.jar:./lib/jena/icu4j_3_4.jar:./lib/jena/iri.jar:./lib/jena/jena.jar:./lib/jena/xercesImpl.jar:./lib/kaon2.jar:./lib/owlapi/antlr-runtime-3.0.jar:./lib/owlapi/commons-lang-2.2.jar:./lib/owlapi/owlapi-api.jar:./lib/owlapi/owlapi-apibinding.jar:./lib/owlapi/owlapi-change.jar:./lib/owlapi/owlapi-debugging.jar:./lib/owlapi/owlapi-dig1_1.jar:./lib/owlapi/owlapi-functionalparser.jar:./lib/owlapi/owlapi-functionalrenderer.jar:./lib/owlapi/owlapi-impl.jar:./lib/owlapi/owlapi-krssparser.jar:./lib/owlapi/owlapi-mansyntaxparser.jar:./lib/owlapi/owlapi-mansyntaxrenderer.jar:./lib/owlapi/owlapi-metrics.jar:./lib/owlapi/owlapi-oboparser.jar:./lib/owlapi/owlapi-owlxmlparser.jar:./lib/owlapi/owlapi-owlxmlrenderer.jar:./lib/owlapi/owlapi-rdfapi.jar:./lib/owlapi/owlapi-rdfxmlparser.jar:./lib/owlapi/owlapi-rdfxmlrenderer.jar:./lib/owlapi/owlapi-util.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.server.DLLearnerWSStart $@ \ No newline at end of file +java -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCT++OWLAPI-v1.1.10+.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.1.jar:./lib/jena/concurrent.jar:./lib/jena/icu4j_3_4.jar:./lib/jena/iri.jar:./lib/jena/jena.jar:./lib/jena/json.jar:./lib/jena/xercesImpl.jar:./lib/junit-4.4.jar:./lib/log4j.jar:./lib/owlapi/antlr-runtime-3.0.jar:./lib/owlapi/commons-lang-2.2.jar:./lib/owlapi/owlapi-api.jar:./lib/owlapi/owlapi-apibinding.jar:./lib/owlapi/owlapi-change.jar:./lib/owlapi/owlapi-debugging.jar:./lib/owlapi/owlapi-dig1_1.jar:./lib/owlapi/owlapi-functionalparser.jar:./lib/owlapi/owlapi-functionalrenderer.jar:./lib/owlapi/owlapi-impl.jar:./lib/owlapi/owlapi-krssparser.jar:./lib/owlapi/owlapi-mansyntaxparser.jar:./lib/owlapi/owlapi-mansyntaxrenderer.jar:./lib/owlapi/owlapi-metrics.jar:./lib/owlapi/owlapi-oboparser.jar:./lib/owlapi/owlapi-owlxmlparser.jar:./lib/owlapi/owlapi-owlxmlrenderer.jar:./lib/owlapi/owlapi-rdfapi.jar:./lib/owlapi/owlapi-rdfxmlparser.jar:./lib/owlapi/owlapi-rdfxmlrenderer.jar:./lib/owlapi/owlapi-util.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.server.DLLearnerWSStart $@ \ No newline at end of file Modified: trunk/bin/ws.bat =================================================================== --- trunk/bin/ws.bat 2008-02-06 16:36:56 UTC (rev 503) +++ trunk/bin/ws.bat 2008-02-06 17:04:01 UTC (rev 504) @@ -1 +1 @@ -java -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\commons-logging.jar;.\lib\jena\concurrent.jar;.\lib\jena\icu4j_3_4.jar;.\lib\jena\iri.jar;.\lib\jena\jena.jar;.\lib\jena\xercesImpl.jar;.\lib\kaon2.jar;.\lib\owlapi\antlr-runtime-3.0.jar;.\lib\owlapi\commons-lang-2.2.jar;.\lib\owlapi\owlapi-api.jar;.\lib\owlapi\owlapi-apibinding.jar;.\lib\owlapi\owlapi-change.jar;.\lib\owlapi\owlapi-debugging.jar;.\lib\owlapi\owlapi-dig1_1.jar;.\lib\owlapi\owlapi-functionalparser.jar;.\lib\owlapi\owlapi-functionalrenderer.jar;.\lib\owlapi\owlapi-impl.jar;.\lib\owlapi\owlapi-krssparser.jar;.\lib\owlapi\owlapi-mansyntaxparser.jar;.\lib\owlapi\owlapi-mansyntaxrenderer.jar;.\lib\owlapi\owlapi-metrics.jar;.\lib\owlapi\owlapi-oboparser.jar;.\lib\owlapi\owlapi-owlxmlparser.jar;.\lib\owlapi\owlapi-owlxmlrenderer.jar;.\lib\owlapi\owlapi-rdfapi.jar;.\lib\owlapi\owlapi-rdfxmlparser.jar;.\lib\owlapi\owlapi-rdfxmlrenderer.jar;.\lib\owlapi\owlapi-util.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.server.DLLearnerWSStart %* \ No newline at end of file +java -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCT++OWLAPI-v1.1.10+.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.1.jar;.\lib\jena\concurrent.jar;.\lib\jena\icu4j_3_4.jar;.\lib\jena\iri.jar;.\lib\jena\jena.jar;.\lib\jena\json.jar;.\lib\jena\xercesImpl.jar;.\lib\junit-4.4.jar;.\lib\log4j.jar;.\lib\owlapi\antlr-runtime-3.0.jar;.\lib\owlapi\commons-lang-2.2.jar;.\lib\owlapi\owlapi-api.jar;.\lib\owlapi\owlapi-apibinding.jar;.\lib\owlapi\owlapi-change.jar;.\lib\owlapi\owlapi-debugging.jar;.\lib\owlapi\owlapi-dig1_1.jar;.\lib\owlapi\owlapi-functionalparser.jar;.\lib\owlapi\owlapi-functionalrenderer.jar;.\lib\owlapi\owlapi-impl.jar;.\lib\owlapi\owlapi-krssparser.jar;.\lib\owlapi\owlapi-mansyntaxparser.jar;.\lib\owlapi\owlapi-mansyntaxrenderer.jar;.\lib\owlapi\owlapi-metrics.jar;.\lib\owlapi\owlapi-oboparser.jar;.\lib\owlapi\owlapi-owlxmlparser.jar;.\lib\owlapi\owlapi-owlxmlrenderer.jar;.\lib\owlapi\owlapi-rdfapi.jar;.\lib\owlapi\owlapi-rdfxmlparser.jar;.\lib\owlapi\owlapi-rdfxmlrenderer.jar;.\lib\owlapi\owlapi-util.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.server.DLLearnerWSStart %* \ No newline at end of file Modified: trunk/doc/eclipse/classpath.dist =================================================================== --- trunk/doc/eclipse/classpath.dist 2008-02-06 16:36:56 UTC (rev 503) +++ trunk/doc/eclipse/classpath.dist 2008-02-06 17:04:01 UTC (rev 504) @@ -3,15 +3,6 @@ <classpathentry kind="src" path="src/dl-learner"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="lib/dig1.1-xmlbeans.jar"/> - <classpathentry kind="lib" path="lib/kaon2.jar"/> - <classpathentry kind="lib" path="lib/xbean.jar"/> - <classpathentry kind="lib" path="lib/jena/antlr-2.7.5.jar"/> - <classpathentry kind="lib" path="lib/jena/commons-logging.jar"/> - <classpathentry kind="lib" path="lib/jena/concurrent.jar"/> - <classpathentry kind="lib" path="lib/jena/icu4j_3_4.jar"/> - <classpathentry kind="lib" path="lib/jena/iri.jar"/> - <classpathentry kind="lib" path="lib/jena/jena.jar"/> - <classpathentry kind="lib" path="lib/jena/xercesImpl.jar"/> <classpathentry kind="lib" path="lib/owlapi/antlr-runtime-3.0.jar"/> <classpathentry kind="lib" path="lib/owlapi/commons-lang-2.2.jar"/> <classpathentry kind="lib" path="lib/owlapi/owlapi-api.jar"/> @@ -33,5 +24,22 @@ <classpathentry kind="lib" path="lib/owlapi/owlapi-rdfxmlparser.jar"/> <classpathentry kind="lib" path="lib/owlapi/owlapi-rdfxmlrenderer.jar"/> <classpathentry kind="lib" path="lib/owlapi/owlapi-util.jar"/> + <classpathentry kind="lib" path="lib/jena/antlr-2.7.5.jar"/> + <classpathentry kind="lib" path="lib/jena/concurrent.jar"/> + <classpathentry kind="lib" path="lib/jena/icu4j_3_4.jar"/> + <classpathentry kind="lib" path="lib/jena/iri.jar"/> + <classpathentry kind="lib" path="lib/jena/jena.jar"/> + <classpathentry kind="lib" path="lib/jena/xercesImpl.jar"/> + <classpathentry kind="lib" path="lib/xbean.jar"/> + <classpathentry kind="lib" path="lib/fact/FaCT++OWLAPI-v1.1.10+.jar"/> + <classpathentry kind="lib" path="lib/pellet/aterm-java-1.6.jar"/> + <classpathentry kind="lib" path="lib/pellet/pellet.jar"/> + <classpathentry kind="lib" path="lib/pellet/relaxngDatatype.jar"/> + <classpathentry kind="lib" path="lib/pellet/xsdlib.jar"/> + <classpathentry kind="lib" path="lib/jena/arq.jar"/> + <classpathentry kind="lib" path="lib/jena/commons-logging-1.1.jar"/> + <classpathentry kind="lib" path="lib/junit-4.4.jar"/> + <classpathentry kind="lib" path="lib/log4j.jar"/> + <classpathentry kind="lib" path="lib/jena/json.jar"/> <classpathentry kind="output" path="classes"/> </classpath> Modified: trunk/src/dl-learner/org/dllearner/Info.java =================================================================== --- trunk/src/dl-learner/org/dllearner/Info.java 2008-02-06 16:36:56 UTC (rev 503) +++ trunk/src/dl-learner/org/dllearner/Info.java 2008-02-06 17:04:01 UTC (rev 504) @@ -3,6 +3,6 @@ package org.dllearner; public class Info { - public static final String build = "2007-08-29"; + public static final String build = "2008-02-06"; } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-06 16:37:03
|
Revision: 503 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=503&view=rev Author: sknappe Date: 2008-02-06 08:36:56 -0800 (Wed, 06 Feb 2008) Log Message: ----------- fixed a bug Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-06 16:36:36 UTC (rev 502) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-06 16:36:56 UTC (rev 503) @@ -140,12 +140,7 @@ $array["http://dbpedia.org/resource/".str_replace(" ","_",$subject)]="http://dbpedia.org/resource/".str_replace(" ","_",$subject); $_SESSION['positive']=$array; } - - - //BUILD SEARCHRESULT - if ($fromCache==-1) - $searchResult.="<a href=\"\" onclick=\"xajax_getsubjects('".$subject."');return false;\">Show more Results</a>"; - + } catch (Exception $e) { $content=$e->getMessage(); @@ -159,6 +154,10 @@ $artTitle=$_SESSION['articles'][$fromCache]['subject']; } + //BUILD SEARCHRESULT + if ($fromCache==-1) + $searchResult.="<a href=\"\" onclick=\"xajax_getsubjects('".$subject."');return false;\">Show more Results</a>"; + //Build lastArticles if (isset($_SESSION['articles'])){ foreach ($_SESSION['articles'] as $key => $value) @@ -339,9 +338,10 @@ session_start(); $id=$_SESSION['id']; $ksID=$_SESSION['ksID']; - session_write_stop(); - setRunning("true"); + session_write_close(); + setRunning($id,"true"); + $content=""; try{ require_once("DLLearnerConnection.php"); @@ -354,7 +354,7 @@ } catch (Exception $e){ $content=$e->getMessage(); } - + $objResponse = new xajaxResponse(); $objResponse->assign("searchcontent", "innerHTML", $content); return $objResponse; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |