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...> - 2011-11-02 08:43:52
|
Revision: 3357 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3357&view=rev Author: jenslehmann Date: 2011-11-02 08:43:43 +0000 (Wed, 02 Nov 2011) Log Message: ----------- improved reasoner unit test Modified Paths: -------------- trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java trunk/examples/father.conf trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf Added Paths: ----------- trunk/components-core/src/test/resources/nlp2rdf/ trunk/components-core/src/test/resources/nlp2rdf/positives.owl trunk/components-core/src/test/resources/nlp2rdf/sso.owl trunk/components-core/src/test/resources/nlp2rdf/string.owl Modified: trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java 2011-11-02 08:35:44 UTC (rev 3356) +++ trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java 2011-11-02 08:43:43 UTC (rev 3357) @@ -42,7 +42,7 @@ @Test public void nlp2rdfTest() throws ComponentInitException { // read file into reasoner - OWLFile file = new OWLFile("../examples/nlp2rdf/reuters_gold_vs_copper/positives.owl"); + OWLFile file = new OWLFile("src/test/resources/nlp2rdf/positives.owl"); file.init(); FastInstanceChecker fic = new FastInstanceChecker(); fic.setSources(file); @@ -55,13 +55,13 @@ Individual ind = new Individual("http://nlp2rdf.org/POS/2/offset_0_763_COPPER+STUDY+GROUP+C"); +// System.out.println(); + // there should be several subStringTrans relations assertFalse(fic.getRelatedIndividuals(ind, op).isEmpty()); // individual should be member of this expression (required to learn the correct concept) assertTrue(fic.hasType(is, ind)); - - // TODO: once this works, we need to make sure that "positives.owl" is in a "stable" directory - + } } Added: trunk/components-core/src/test/resources/nlp2rdf/positives.owl =================================================================== --- trunk/components-core/src/test/resources/nlp2rdf/positives.owl (rev 0) +++ trunk/components-core/src/test/resources/nlp2rdf/positives.owl 2011-11-02 08:43:43 UTC (rev 3357) @@ -0,0 +1,25676 @@ +<rdf:RDF + xmlns:j.0="http://purl.org/olia/stanford.owl#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:j.1="http://purl.org/olia/penn-syntax.owl#" + xmlns:str="http://nlp2rdf.lod2.eu/schema/string/" + xmlns:j.2="http://purl.org/olia/system.owl#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:sso="http://nlp2rdf.lod2.eu/schema/sso/" + xmlns:j.3="http://purl.org/olia/olia.owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:j.4="http://purl.org/olia/penn.owl#" + xmlns:j.5="http://purl.org/olia/olia-top.owl#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> + <owl:Ontology rdf:about="file://something/positives"> + <owl:imports rdf:resource="string.owl"/> + <owl:imports rdf:resource="sso.owl"/> + </owl:Ontology> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Residual"> + <rdfs:comment> + The residual value (R) is assigned to classes of text words which lie outside the + traditionally accepted range of grammatical classes, although they occur quite + commonly in many texts and very commonly in some. For example: foreign words, + or mathematical formulae. It can be argued that these are on the fringes of the + grammar or lexicon of the language in which the text is written. Nevertheless, + they need to be tagged. (http://www.ilc.cnr.it/EAGLES96/annotate/node16.html#mr 19.09.06) + + Although words in the Residual category are on the periphery of the lexicon, they may + take some of the grammatical characteristics, e.g., of nouns. Acronyms such as IBM are + similar to proper nouns; symbols such as alphabetic characters can vary for singular and + plural (e.g. How many Ps are there in `psychopath'?), and are in this respect like common + nouns. In some languages (e.g. Portuguese) such symbols also have gender. It is quite + reasonable that in some tagging schemes some of these classes of word will be classified + under other parts of speech. (The Unclassified category applies to word-like text segments + which do not easily fit into any of the foregoing values. For example: incomplete words + and pause fillers such as er and erm in transcriptions of speech, or written representations of singing such as dum-de-dum. (http://www.ilc.cnr.it/EAGLES96/annotate/node17.html#recr 19.09.06)</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Conjunction"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + </rdfs:subClassOf> + <rdfs:comment> + A conjunction is a word that syntactically links words or larger constituents, + and expresses a semantic relationship between them. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAConjunction.htm 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#LinguisticConcept"> + <rdfs:comment>The OLiA ontology specifies linguistic concepts on a theoretical basis, as for concepts used in annotations, see system.owl. +There is a great extent of overlap between LinguisticCategories/LinguisticFeatures and Categories/Features as defined in system.owl.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://www.w3.org/2002/07/owl#Thing"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#VerbPhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#VerbPhrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:comment>VP|Verb phrase. Phrasal category headed a verb. +(Santorini 1991) + +VP — Verb Phrase. Phrasal category headed a verb. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#PrepositionalPhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PrepositionalPhrase"/> + </rdfs:subClassOf> + <rdfs:comment>PP|Prepositional_phrase. Phrasal_category_headed_by_a_preposition. +(Santorini 1991) + +PP — Prepositional Phrase. Phrasal category headed by a preposition. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#WHDeterminer"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Determiner"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#TenseFeature"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </rdfs:subClassOf> + <rdfs:comment>Tense is a grammatical category, typically marked on the verb, that deictically refers to the time of the event or state denoted by the verb in relation to some other temporal reference point. (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsTense.htm 17.11.06)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#CardinalNumber"> + <rdfs:comment> + A cardinal numeral is a numeral of the class whose members are considered basic + in form, used in counting, and used in expressing how many objects are referred to. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsACardinalNumeral.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Numeral"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/system.owl#LinguisticAnnotation"> + <rdfs:comment>Linguistic annotations pertain to either structural entities (words, tokens, constituents, sentences => UnitOfAnnotation), relations between these (dependency, dominance, coreference, etc. => Relation), or grammatical features attached to these (case, gender, number, agreement, tense, mood, aspect, ... => Feature).</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AuxiliaryVerb"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment> + An auxiliary verb is a verb which accompanies the lexical verb of a verb phrase, + and expresses grammatical distinctions not carried by the lexical verb, such as + person, number, tense aspect, and voice. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAnAuxiliaryVerb.htm 19.09.06) + + Besides modal verbs ("semiauxiliary") and "strict" auxiliary verbs, also copulas + are classified under auxiliary verbs here, as this is a praxis applied in practically every + EAGLES-conformant morphosyntactic annotation scheme. + + Part of speech referring to the set of verbs, subordinate to the main lexical verb which help + to make distinction in mood, aspect, voice etc. + (Crystal 2003; http://www.isocat.org/datcat/DC-1244) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#CardinalNumber"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#CardinalNumber"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:comment>These are cardinal numbers.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#DegreeFeature"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </rdfs:subClassOf> + <rdfs:comment>The Eagles-recommended attribute Degree applies only to inflectional comparatives and superlatives. In some languages, e.g. Spanish, the number of such adjectives is very small. (http://www.ilc.cnr.it/EAGLES96/annotate/node17.html#recn)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#To"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:comment>"To" is tagged TO, regardless of whether it is a preposition or an infinitival marker.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"> + <rdfs:label>word</rdfs:label> + <rdfs:comment> + SyntacticWord is the class of syntactic units occupying the lowest position in + a syntactic construction. They are the largest units resistant to insertion of + new constituents within their boundaries; or they are the smallest constituents + that can be moved within a sentence without making the sentence ungrammatical. + (http://www.linguistics-ontology.org/gold/2008/SyntacticWord) + + Linguistic unit composed of at least a part of speech and a lemma. + (Gil Francopoulo; http://www.isocat.org/datcat/DC-1415) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NonFiniteVerb"> + <rdfs:comment> + Verb forms occurring on their own only in dependent clauses and lacking tense and mood contrasts. + (adapted from Crystal 2003; http://www.isocat.org/datcat/DC-1332) + + A non-finite verb is a verb that is not fully inflected for categories that are marked inflectionally in a language, + such as the following: Tense, Aspect, Modality, Number, Person. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsANonfiniteVerb.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Verb"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Conjunction"> + <rdfs:comment>This class was inserted to reflect the tag structure. It does not, + however, exactly correspond to olia:Conjunction, because Penn conjunction + tags can also be applied to prepositions.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#CoordinatingConjunction"> + <rdfs:comment> + Coordinating conjunctions, also called coordinators, are conjunctions that + join two items of equal syntactic importance. + (http://en.wikipedia.org/wiki/Grammatical_conjunction 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Conjunction"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PrepositionalPhrase"> + <rdfs:comment> + A sequence of a preposition and its complement is a prepositional phrase. The complement of a preposition is usually + a noun phrase (see examples 38 to 40), but may also be a clause or an adverb phrase. According to the categories + recommended here, a prepositional phrase may be analysed further into preposition and noun phrase. The examples + below demonstrate how this further analysis can be a recursive procedure. + + (38) [PP en [NP sustitucion [PP de [NP los canales correspondientes [PP de [NP 50 baudios NP] PP] NP] PP] NP] PP]. + (39) [NP Fairbanks NP] [VP hummed [NP a few bars NP] VP] [PP in [NP a voice [VP made resonant + [PP by [NP the very weakness [PP of [NP his chest NP] PP] NP] PP] VP] NP] PP]. + (40) [PP En [NP el caso [PP de [NP un sistema mixto [PP en [NP el + [CL que [VP se utilicen [NP canales [PP con [NP tres velocidades + [PP de [NP modulacion NP] PP] diferentes NP] PP] NP] VP] CL] NP] PP] NP] PP] NP] PP] + + In a language such as Spanish, where a large proportion of the modification of nouns takes the form of a following + preposition de and another noun, this recursion is extremely prevalent, as in 40. In cases where the prepositional + phrase is complemented by a one word noun phrase, it may be advantageous to leave the analysis at this point, rather + than continuing to analyse further by enclosing the complement (see also one-word constituents). + + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node34.html#SECTION00052500000000000000) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounHeadedPhrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PastParticiple"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Participle"/> + </rdfs:subClassOf> + <rdfs:comment>This is a verb in past participle.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#NounPhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounPhrase"/> + </rdfs:subClassOf> + <rdfs:comment>NP|Noun phrase. Phrasal category that includes all constituents that depend on a head noun. +(Santorini 1991) + +NP — Noun Phrase. Phrasal category that includes all constituents that depend on a head noun. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/system.owl#UnitOfAnnotation"> + <rdfs:comment>A UnitOfAnnotation is a structural entity that can be annotated, e.g., a word, token, constituent, or another types of markable. +Word classes, etc., are then modelled as indirect children of UnitOfAnnotation. The division between Features and classes of UnitsOfAnnotation follows conventional standards. + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/system.owl#LinguisticAnnotation"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Present"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AbsoluteTense"/> + </rdfs:subClassOf> + <rdfs:comment> + Present tense refers to the moment of utterance. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#presentTense) + + Present tense refers to the moment of utterance. + It often refers to events or states that do not merely coincide + with the moment of utterance, such as those that are continuous, + habitual, or lawlike. + (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsPresentTense.htm 17.11.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Plural"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#NumberFeature"/> + </rdfs:subClassOf> + <rdfs:comment> + Plural is a grammatical number, typically referring to more than one of + the referent in the real world. In English, nouns, pronouns, and demonstratives + inflect for plurality. In many other languages, for example German and the + various Romance languages, articles and adjectives also inflect for plurality. + (http://en.wikipedia.org/wiki/Plural 17.11.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#GerundOrPresentParticiple"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ing"/> + </rdfs:subClassOf> + <rdfs:comment>This is a verb in present participle or in gerund.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Pronoun"> + <rdfs:comment>This is a class, we inserted to structure the tagset.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Pronoun"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Clause"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SyntaxTag"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Clause"/> + </rdfs:subClassOf> + <rdfs:comment>We distinguish among a number of basic clause types: S, SINV, SBAR, RRC, SBARQ, SQ, S-CLF, it-extraposition, and FRAG. +(Bies et al. 1995) + +S-CLF is @cat="S" & edge/@func="CLF", so see under ItCleft</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Constituent"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"/> + </rdfs:subClassOf> + <rdfs:comment> + Constituents correspond to a GOLD SyntacticConstruction: + SyntacticConstruction is the class of grammar units that + have syntactic structure, i.e., consisting of more than + one syntactic word or construction in a syntactic + configuration. [Crystal 1980, 85-86]. + (http://www.linguistics-ontology.org/gold/2008) + + Corresponds to units of annotation in the EAGLES recommendations for syntactic annotation + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node29.html#SECTION00052000000000000000) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#NumberFeature"> + <rdfs:comment> + Grammatical category for the variation in form of nouns, pronouns, and any words agreeing + with them, depending on how many persons or things are referred to. + (www.wordreference.com/English/definition.asp?en=number 12; http://www.isocat.org/datcat/DC-1298) + + A grammatical number is a morphological category characterized by the expression of quantity + through inflection or agreement. (http://en.wikipedia.org/wiki/Grammatical_number 17.11.06)</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#ParentheticalNode"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SyntaxTag"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ParentheticalPunctuation"/> + </rdfs:subClassOf> + <rdfs:comment>Parenthetical elements are dominated by a node labeled PRN. Punctuation marks that set off a parenthetical (i.e., commas, dashes, parentheses (-LRB- and -RRB-)) are contained within the PRN node. Use of PRN is determined ultimately by individual annotator intuition, though the presence of dashes or parentheses strongly suggests a parenthetical. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#LinguisticConcept"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Adjective"> + <rdfs:comment> + An Adjective is a noun-modifying expression that specifies the properties or attributes of the nominal referent. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAnAdjective.htm 18.9.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AbsoluteTense"> + <rdfs:label>absolute tense</rdfs:label> + <rdfs:comment> + Absolute tense refers to a time in relation to the moment of utterance. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#absoluteTense with + reference to http://www.sil.org/linguistics/glossaryoflinguisticterms/whatisabsolutetense.htm") + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#TenseFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Gerund"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#NonFiniteVerb"/> + <rdfs:comment> + property for a non-finite form of a verb other than the infinitive. + (http://www.isocat.org/datcat/DC-2243) + + A gerund is a kind of verbal noun that exists in some languages. In today's English, + gerunds are nouns built from a verb with an '-ing' suffix. They can be used as the + subject of a sentence, an object, or an object of preposition. They can also be used + to complement a subject. Often, gerunds exist side-by-side with nouns that come from + the same root but the gerund and the common noun have different shades of meaning. + (http://en.wikipedia.org/wiki/Gerund, http://en.wikibooks.org/wiki/English:Gerund 19.09.06) + + The term _gerund_ is ambiguous: with respect to Latin, in whose grammatical tradition it originates, it refers to a deverbal noun, and is needed in this function for Polish as well; in descriptions of some other languages, however, it has been used for an adverbial participle. + The two meanings have nothing in common, except that the English _ing_-form can translate both. (Ivan A Derzhanski, email 2010/06/09) + Here, it is assumed that Gerund refers only to deverbal nouns, cf. NominalNonfiniteVerb in the IIIT tagset (http://purl.org/olia/iiit.owl#NominalNonFiniteVerb) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#BePresentTense"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment>These are verbforms in present tense. This class includes 3rd person singular or other than 3rd person singular verbforms.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#BePastTense"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment>This category includes the conditional form of the verb to be. +EXAMPLES: +If I were/VBD rich... +If I were/VBD to win the lottery...</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#VerbPhrase"> + <rdfs:comment> + This category is slightly more difficult to define, since there is disagreement over the extent of the verb phrase. + In particular, should the verb phrase include only the words that are verbs, or should it also include the + complements of the verb? In the examples given in this document, and in the sample texts in the appendices, we have + chosen to include the complements, but it must be noted that this is an open issue, and we are in no way implying + that this analysis is preferable to the alternative. The choice to be made at this level, i.e. the inclusion or + exclusion of verbal complements in the Verb Phrase, is shown by the examples in 27 and 28, 27 showing the inclusion + of the complement of the verb in the verb phrase and 28 excluding the complement: + + (27) He [VP took up [NP a clothes brush NP] VP] + (28) He [VP took up VP] [NP a clothes brush NP] + + An advantage in the type of analysis shown in 27 is that the relative levels of the constituents can be shown to a + greater extent -- i.e. complements of the verb are included in the verb phrase, while adjuncts and peripheral + adverbials are left at sentence level. + + However, in a case where an adjunct occurs before the complement of the verb, the approaches used in 27 and 28 would + cause problems, since either both the adjunct and the complement would be included as daughters of the verb phrase, + or both would be daughters of the sentence, rather than keeping the complement as a daughter of the verb phrase and + the adjunct as a sister of the verb phrase. These problems may be solved by an additional notation, but at some + level, arbitrariness is inevitable. + + Regardless of the choice made over the extent of the Verb Phrase, there arises a problem of discontinuous Verb + Phrases. A complex verbal construction may be discontinuous, e.g. the auxiliary and the main verb are separated in + inverted constructions in English, or the main verb is positioned at the end of the sentence in German and Dutch. + Such discontinuity can be avoided by having different labels and constituents for the auxiliary verb and the main + verb, resulting in an analysis as shown in the Dutch example 29 below: + + (29) [NP Ze NP] [AUX zullen AUX] [ADVP er ADVP] [VP [NP de VN-agenda + [PP voor [NP het komende jaar NP] PP] NP] behandelen VP]. + + and in the English interrogative inverted example 30, using the so-called `dummy auxiliary' do: + + (30) [AUX Do AUX] [NP they NP] [VP confide [PP in you PP] VP]? + + As with Noun Phrases, Verb Phrases can be identified by a constituency test. In strong constituency languages like + English, the whole VP can be moved, but not part of it: compare 31 and 32: + + (31) Give in to blackmail, I never will + (32) *Give in, I never will to blackmail + + However, there are languages in which constituent tests do not work. These will typically be languages with flexible + word order, such as Finnish. 33 is an example of a discontinuous VP (Vilkuna 1989: 26): + + (33) Maailmaa nähnyt hän on. + world-Part seen he is + `He IS a widely-travelled person.' + + For Finnish, then, evidence for a VP is less convincing than it is for English, and a dependency approach seems the + more natural choice. (Covington (1990) provides a parsing strategy for variable word order languages and Covington + (1991) for parsing discontinuous constituents, both using a dependency syntax approach.) + + In Italian also, constituency tests cannot be applied. This can be shown through the distribution of VP-adverbs + (e.g. completamente `completely', intenzionalmente `intentionally', attentamente `carefully') and S-adverbs (e.g. + probabilmente `probably', certamente `certainly'). In English, these different classes of adverbs have a different + distribution within the sentence. In contrast, in Italian, the distinct adverb classes cannot be distinguished on + the basis of their distribution in the sentence. S-adverbs and VP-adverbs can occur in the same positions within the + sentence, as illustrated in examples 34 to 37: + + (34) Attentamente/certamente, il bambino ascoltó la storia + `Carefully/certainly, the child listened to the story' + (35) Il bambino attentamente/certamente ascoltó la storia + `The child carefully/certainly listened to the story' + (36) Il bambino ascoltó attentamente/certamente la storia + `The child listened carefully/certainly to the story' + (37) Il bambino ascoltó la storia attentamente/certamente + `The child listened to the story carefully/certainly' + + Thus, in Italian as well as other languages, neither the position nor the syntactic context can help to decide + whether an adverb is an S-adverb or a VP-adverb; this can only be stated by considering its semantic content and the + way it relates to the content of the predicate or the sentence. This situation has consequences for the success of + standard VP-tests. + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node33.html) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Phrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#SecondaryPunctuation"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Punctuation"/> + </rdfs:subClassOf> + <rdfs:comment> + Punctuation that is not very important with regards to sentence splitting in a text. + (http://www.isocat.org/datcat/DC-2076) + </rdfs:comment> + <rdfs:label>secondary punctuation</rdfs:label> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Noun"> + <rdfs:comment>We inserted this class 'noun' to get a clearer ontology structure. In The Penn Treebank Tag Set there is no class 'noun'.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Noun"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Verb"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:comment> + A verb is a part of speech that usually denotes action ("bring", "read"), + occurrence ("decompose", "glitter"), or a state of being ("exist", "stand"). + Depending on the language, a verb may vary in form according to many factors, + possibly including its tense, aspect, mood and voice. It may also agree with + the person, gender, and/or number of some of its arguments (subject, object, etc.). + (http://en.wikipedia.org/wiki/Verb 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Adverb"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Adverb"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:comment>This category includes most words that end in -ly as well as degree words like "quite", "too" and "very", posthead modifiers like "enough" and "indeed" (as in "good enough", "very well indeed"), and negative markers like "not", "n' t" and "never".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#AdjectivePhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AdjectivePhrase"/> + </rdfs:subClassOf> + <rdfs:comment>ADJP|Adjective phrase. Phrasal category headed by an adjective (including comparative and +superlative adjectives). Example: outrageously expensive. +(Santorini 1991) + +ADJP — Adjective Phrase. Phrasal category headed by an adjective (including comparative and superlative adjectives). Example: outrageously expensive. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SubordinateClause"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#SubordinateClause"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn-syntax.owl#Clause"/> + <rdfs:comment>SBAR|Clause introduced by a (possibly empty) subordinating conjunction. +(Santorini 1991) + +SBAR is used for relative clauses and subordinate clauses, including indirect questions. ... +SBAR — Clause introduced by a (possibly empty) subordinating conjunction. + +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#ComparativeAdjective"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Adjective"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Comparative"/> + </rdfs:subClassOf> + <rdfs:comment>These are adjectives mostly with the comparative ending -er and a comparative meaning. "More" or "less" should be tagged as a comparative adjective when it is used without a head noun and it +corresponds to the object of a verb or preposition.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Phrase"> + <rdfs:comment> + Phrase is the class of syntactic constructions that consist of one or more + syntactic words, but lack the subject-predicate organization of a clause. + Phrases get their grammatical characteristics according to what word occupies + the head position; thus, all phrases have heads [Crystal 1980, 232-233; Pei + and Gaynor 1954, 169; Pike and Pike 1982, 453]. + (http://purl.org/linguistics/gold/Phrase) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Constituent"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounPhrase"> + <rdfs:comment> + At phrase level, the noun phrase is probably the least problematic of the categories to be dealt + with. In general, a noun phrase will a have noun or a pronoun as its head, and included within + the noun phrase are the determinative elements, any premodification, and any postmodification. + The examples below, 14 to 17 show noun phrases with the head noun/pronoun in bold: + + (14) [NP He NP] was a tiny man + (15) [NP his white shirt cuffs NP] + (16) [NP his surprisingly thick and hairy wrists NP] + (17) [NP some wholly unanticipated but remotely possible event of absorbing interest NP] + + However, noun phrases may also occur with adjectival heads, as in 18 and 19: + + (18) [NP The unemployed NP] have had enough + (19) We've beaten [NP the best NP] + + or with a head which is a cardinal or ordinal number, as in 20 and 21: + + (20) [NP The ninth NP] is my particular favourite + (21) [NP The other seven NP] continued with the trip + + In `pro-drop' languages, such as Spanish and Italian, pronominal Subjects are usually not expressed. + Depending on the chosen type of analysis, this may require another definition of noun phrase, in order + to include `empty noun phrases', in which the pronoun is not actually present, but may be inferred + from the verb ending. + + A classic constituency test for Noun Phrases is that only whole NPs can be moved within the same sentence. + In English, constituents can be preposed to achieve some effect, as in 23 (from Radford 1988: 70): + + (22) I can't stand your elder sister + (23) Your elder sister I can't stand (though your brother's OK). + + Examples 24 and 25 show that it is not possible to move only part of the NP: + + (24) *Your elder I can't stand sister + (25) *Elder sister, I can't stand your + + However, this test should be used with caution. It works well in English, but not always in other languages. + For example, in 26 Neue Bücher is moved to the beginning of the sentence while keine is left at the end: + + (26) Neue Bücher habe ich keine + new books have I no + `I have not got any new books' + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node32.html) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounHeadedPhrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Parenthetical"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ParentheticalPunctuation"/> + </rdfs:subClassOf> + <rdfs:comment>PRN +— Parenthetical. (See section 2.6 below for a complete description.) +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PossessivePronoun"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Pronoun"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PossessivePronoun"/> + </rdfs:subClassOf> + <rdfs:comment>Both substitutive and attributive 'her' are covered by this categorie. It's thus PossessiveDeterminer or PossessivePronoun.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Determiner"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PronounOrDeterminer"/> + </rdfs:subClassOf> + <rdfs:comment> + A determiner is a noun modifier that expresses the reference of a noun or noun phrase + in the context, including quantity, rather than attributes expressed by adjectives. + This part of speech is defined in some languages, such as in English, as it is distinct + from adjectives grammatically, though most English dictionaries still identify the + determiners as adjectives. + (http://en.wikipedia.org/wiki/Determiner 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#CaseFeature"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </rdfs:subClassOf> + <rdfs:comment>Case is a grammatical category determined by the syntactic or semantic function of a noun or pronoun. The term case has traditionally been restricted to apply to only those languages which indicate certain functions by the inflection of nouns, pronouns, or noun phrase constituents, such as adjectives and numerals. (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsCase.htm 17.11.06)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Quantifier"> + <rdfs:comment> + A quantifier is a determiner that expresses a referent's definite or indefinite number or amount. + A quantifier functions as a modifier of a noun, or pronoun. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAQuantifier.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Superlative"> + <rdfs:comment> + The superlative of an adjective or adverb is a form of adjective or + adverb which indicates that something has some feature to a greater + degree than anything it is being compared to in a given context. + (http://en.wikipedia.org/wiki/Superlative 17.11.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#DegreeFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Pronoun"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PronounOrDeterminer"/> + </rdfs:subClassOf> + <rdfs:comment> + A pronoun is a pro-form which functions like a noun and substitutes for a + noun or a noun-phrase. A language may have several classes of pronouns. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAPronoun.htm 19.09.06) + + A pronominal is a phrase that functions as a pronoun + (www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAPronominal.htm; http://www.isocat.org/datcat/DC-1369) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Clause"> + <rdfs:comment> + Traditionally sentences are deemed to be composed of major constituents + known as clauses, which may be main clauses (not included in a superordinate + clause) or embedded clauses (included in a superordinate clause) such as + relative clauses or adverbial clauses. A main clause, unless it is coordinated, + is equivalent to a simple sentence, and does not need to be separately labelled. + Embedded and coordinated clauses, on the other hand, will need to be separately + identified. We recommend that such units be identified in the annotation, and + labelled either as sentences (S) or as clauses (CL), according to the preference + specified in the annotation scheme. + + The reason for allowing choice here is that different theoretical preferences + have to be accommodated. In some syntactic models, the `clause' category is not + used (except informally), embedded clauses being marked by included [S] + constituents. In other models, clauses are identified as such, even where they + are coextensive with an independent sentence. + + One solution which commends itself (and is employed in the Lancaster Treebank and + the SUSANNE Corpus) is to retain [S ... S] as the delimiter of sentences, whether + included or not, and also to use [S ... S] for the coordinated parts of a compound + sentence; but to use `clause' labels for subordinate clauses. An example which + illustrates this division is 12: + + (12) [S [S The distinction at issue is relatively clear S] , but [S closer + examination reveals [CL that all is not quite so straightforward + [CL as it seems CL] CL] S] . S] + + Embedded (subordinate) clauses are generally identified by some sign of their + dependence on the superordinate clause or sentence, such as an introductory + conjunction or a non-finite verb form. It is noticeable that the coordinated + parts of the compound sentence do not have to be clause-like units with subjects + and verbs, and to this extent [CL] would be a misleading label to apply to them. + This is true, in 13, of so far so good in: + + (13) [S [S So far so good S] , but [S now consider gender in adjectives S] . S] + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node31.html) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Constituent"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/system.owl#Feature"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#LinguisticConcept"/> + <rdfs:comment>Morphosyntactic and morphological features.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#WhDeterminer"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#WHDeterminer"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Determiner"/> + </rdfs:subClassOf> + <rdfs:comment>This category includes "which", as well as that when it is used as a relative pronoun.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Noun"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:comment> + A noun, or noun substantive, is a part of speech (a word or phrase) which can co-occur with + (in)definite articles and attributive adjectives, and function as the head of a noun phrase. + + The word "noun" derives from the Latin 'nomen' meaning "name", and a traditional definition + of nouns is that they are all and only those expressions that refer to a person, place, + thing, event, substance, quality, idea or an appointment. They serve as the subject or object + of a verb, and the object of a preposition. + (http://en.wikipedia.org/wiki/Noun 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#ProperNoun"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ProperNoun"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Noun"/> + <rdfs:comment>These are singular or plural proper nouns.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Past"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#AbsoluteTense"/> + <rdfs:comment> + The past tense is a verb tense expressing action, activity, state + or being in the past. (http://en.wikipedia.org/wiki/Past_tense 17.11.06) + + The past tense refers to a tense category which places an event in the past. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#pastTense) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Singular"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#NumberFeature"/> + <rdfs:comment> + Singular is a grammatical number denoting a unit quantity (as opposed + to the plural and other forms). (http://en.wikipedia.org/wiki/Singular + 17.11.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ModalVerb"> + <rdfs:comment> + Verb form that is usually used with another verb to express ideas such as possibilities, permission, or intention. + (Gil Francopoulo; http://www.isocat.org/datcat/DC-1329) + + A modal verb (also modal, modal auxiliary verb, modal auxiliary) is a type of auxiliary + verb that is used to indicate modality. The use of auxiliary verbs to express modality + is characteristic of Germanic languages. + (http://en.wikipedia.org/wiki/Modal_verb 19.09.06) + + In addition to main and auxiliary verbs, it may be useful (e.g. in English) to recognise an intermediate + category of semi-auxiliary for such verbs as be going to, have got to, ought to. + (http://www.ilc.cnr.it/EAGLES96/annotate/node18.html#oav1v 20.09.06) + + The auxiliaries in English subdivide into the primary verbs `be', `have', and `do', which can also function + as main verbs, and the modal auxiliaries such as `can', `will', and `would', which are uninflected, and always + function as auxiliaries. + (http://www.ilc.cnr.it/EAGLES96/morphsyn/node158.html#SECTION00054800000000000000) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#AuxiliaryVerb"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#SubordinateClause"> + <rdfs:comment> + SubordinateClause is the class of clauses that cannot stand on their + own as sentences. A matrix clause combined with a subordinate clause + form a main clause. In the sentence 'John thinks that Mary is sick', + 'Mary is sick' is the subordinate clause. + (http://purl.org/linguistics/gold/SubordinateClause) + + Dependent clauses (which are also sometimes referred to as subordinate + clauses) cannot stand alone as sentences. They usually begin with + subordinating conjunctions. A sentence with an independent clause and + any number of dependent clauses is referred to as a complex sentence. + One with two or more independent clauses and any number of dependent + clauses is referred to as a compound-complex sentence + (http://en.wikipedia.org/wiki/Clause, cf. + http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#subordinateClause). + + A subordinate clause is an embedded construction which contains a finite verb form. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#finiteEmbeddedConstruction) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#FiniteClause"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PossessivePronoun"> + <rdfs:comment> + A possessive pronoun is a pronoun that expresses relationships like ownership, such as kinship, and other forms of association. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAPossessivePronoun.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Pronoun"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Participle"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#NonFiniteVerb"/> + <rdfs:comment> + A participle is a lexical item, derived from a verb that has some of the characteristics and functions of both verbs and adjectives. + In English, participles may be used as adjectives, and in non-finite forms of verbs. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAParticiple.htm 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#GenitiveCase"> + <rdfs:comment> + Genitive case signals that the referent of the marked noun is the possessor + of the referent of another noun, e.g. "the man's foot". In some languages, + genitive case may express an associative relation between the marked noun + and another noun. + (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsGenitiveCase.htm 17.11.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#CaseFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/system.owl#LinguisticAnnotation"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#CommonNoun"> + <rdfs:comment> + A common noun is a noun that signifies a non-specific member of a group. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsACommonNoun.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Noun"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PersonalPronoun"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Pronoun"/> + <rdfs:comment>This category includes the personal pronouns proper, without regard for case distinctions ("I", "me", "you", "he", "him", etc.), the reflexive pronouns ending in -self or -selves, and the nominal possessive pronouns "mine", "yours", "his", "hers", "ours" and "theirs".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Punctuation"> + <rdfs:comment> + Punctuation marks (PU) are treated here as a part of morphosyntactic annotation, as it + is very common for punctuation marks to be tagged and to be treated as equivalent to + words for the purposes of automatic tag assignment. + (http://www.ilc.cnr.it/EAGLES96/annotate/node16.html#mp 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SyntaxTag"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/system.owl#UnitOfAnnotation"/> + <rdfs:comment>Santorini (1991, §4.1), in TIGER cat label of syntactic nodes</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"> + <rdfs:comment>(Bies et al. 1995, §2.1.2)</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Phrase"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn-syntax.owl#SyntaxTag"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Adjective"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Adjective"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:comment>These are adjectives, ordinal numerals, and ordinal numbers. +Hyphenated compounds that are used as modifiers are tagged as adjectives, e.g. "happy-go-lucky", "one-of-a-kind", "run-of-the-mill". Ordinal numbers are tagged as adjectives, as are compounds of the form "n-th" or "X-est", like "fourth-largest".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#ModalVerb"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#ModalVerb"/> + <rdfs:comment>This category includes all verbs that don't take an -s ending in the third person singular present: "can", +"could", ("dare"), "may", "might", "must", "ought", "shall", "should", "will", "would".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ProperNoun"> + <rdfs:comment> + Proper nouns (also called proper names) are the names of unique entities. + (http://en.wikipedia.org/wiki/Noun 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Noun"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Numeral"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Quantifier"/> + <rdfs:comment> + A numeral is a word, functioning most typically as an adjective or pronoun, + that expresses a number, and relation to the number, such as one of the + following: Quantity, Sequence, Frequency, Fraction. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsANumeral.htm 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#CoordinatingConjunction"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Conjunction"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#CoordinatingConjunction"/> + <rdfs:comment>This category includes "and", "but", "nor", "or", "yet" (as in "Yet it's cheap", "cheap yet good"), as well as the mathematical operators "plus", "minus", "less", "times" (in the sense of "multiplied by") and "over" (in the sense of "divided by"), when they are spelled out. +For in the sense of "because" is a coordinating conjunction.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Determiner"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:comment>Not clear whether this corresponds to OLiA/EAGLES determiners, because some predeterminers seem to be adverbs rather than determiners proper.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounHeadedPhrase"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Phrase"/> + <rdfs:comment> + A NounHeadedPhrase takes a nominal as its (semantic) head. + Introduced as a generalization over NounPhrase and PrepositionalPhrase for reasons of consistency with dependency parsers like + Connexor where this differentiation is not made. + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Comparative"> + <rdfs:comment> + The comparative is the form of an adjective or adverb which denotes + the degree or grade by which a person, thing, or other entity has a + property or quality greater or less in extent than that of another. + In English the structure of a comparative consists normally of the + positive form of the adjective or adverb, plus the suffix -er, or + (especially in the case of longer words) the modifier "more" (or + "less") before the adjective or adverb. The form is usually completed + by "than" and the noun which is being compared, e.g. "he is taller + than his father is", or "the village is less picturesque than the + town near by is". (http://en.wikipedia.org/wiki/Comparative 17.11.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#DegreeFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#BaseForm"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment>This tag subsumes imperatives, infinitives and subjunctives. +EXAMPLES: +Imperative: Do/VB it. +Infinitive: You should do/VB it. + We want them to do/VB it. + We made them do/VB it. +Subjunctive: We suggested that he do/VB it.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ing"> + <rdfs:comment>English verb forms ending in '-ing' that represent either Gerunds or Participles.</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Participle"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Gerund"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#FiniteClause"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Clause"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PossessiveEnding"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#GenitiveCase"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Residual"/> + <rdfs:comment>The possessive ending on nouns ending in 's or is split off by the tagging algorithm and tagged as if it +were a separate word. e.g. "John/ NP 's/POS idea", "the parents/NNS'/POS distress".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AdjectivePhrase"> + <rdfs:comment> + An adjective phrase may consist of an adjective, or a sequence of words in which an adjective is the head of the + phrase, as shown in 47 to 50 below. + + (47) [NP his [ADJP surprisingly thick and hairy ADJP] wrists NP] + (48) [NP some [ADJP [ADJP wholly unanticipated ADJP] but [ADJP remotely possible ADJP] ADJP] event NP] + (49) [S [NP His speeches NP] [VP are [ADVP always ADVP] [ADJP too long [PP for comfort PP] ADJP] VP] S] + (50) [AUX have AUX] [NP you NP] [VP found [NP something + [ADJP suitable [PP for [NP your needs NP] PP] ADJP] NP] VP] ? + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node36.html) + </r... [truncated message content] |
From: <lor...@us...> - 2011-11-02 08:35:52
|
Revision: 3356 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3356&view=rev Author: lorenz_b Date: 2011-11-02 08:35:44 +0000 (Wed, 02 Nov 2011) Log Message: ----------- Changed import statements to use the local schema files relative to the current ontology. Modified Paths: -------------- trunk/examples/nlp2rdf/reuters_gold_vs_copper/negatives.owl trunk/examples/nlp2rdf/reuters_gold_vs_copper/positives.owl Modified: trunk/examples/nlp2rdf/reuters_gold_vs_copper/negatives.owl =================================================================== --- trunk/examples/nlp2rdf/reuters_gold_vs_copper/negatives.owl 2011-11-02 07:52:53 UTC (rev 3355) +++ trunk/examples/nlp2rdf/reuters_gold_vs_copper/negatives.owl 2011-11-02 08:35:44 UTC (rev 3356) @@ -12,8 +12,8 @@ xmlns:j.5="http://purl.org/olia/olia-top.owl#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <owl:Ontology rdf:about="file://something/negatives"> - <owl:imports rdf:resource="http://nlp2rdf.lod2.eu/schema/string/"/> - <owl:imports rdf:resource="http://nlp2rdf.lod2.eu/schema/sso/"/> + <owl:imports rdf:resource="string.owl"/> + <owl:imports rdf:resource="sso.owl"/> </owl:Ontology> <owl:Class rdf:about="http://purl.org/olia/olia.owl#Residual"> <rdfs:comment> Modified: trunk/examples/nlp2rdf/reuters_gold_vs_copper/positives.owl =================================================================== --- trunk/examples/nlp2rdf/reuters_gold_vs_copper/positives.owl 2011-11-02 07:52:53 UTC (rev 3355) +++ trunk/examples/nlp2rdf/reuters_gold_vs_copper/positives.owl 2011-11-02 08:35:44 UTC (rev 3356) @@ -12,8 +12,8 @@ xmlns:j.5="http://purl.org/olia/olia-top.owl#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <owl:Ontology rdf:about="file://something/positives"> - <owl:imports rdf:resource="http://nlp2rdf.lod2.eu/schema/string/"/> - <owl:imports rdf:resource="http://nlp2rdf.lod2.eu/schema/sso/"/> + <owl:imports rdf:resource="string.owl"/> + <owl:imports rdf:resource="sso.owl"/> </owl:Ontology> <owl:Class rdf:about="http://purl.org/olia/olia.owl#Residual"> <rdfs:comment> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-11-02 07:52:59
|
Revision: 3355 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3355&view=rev Author: lorenz_b Date: 2011-11-02 07:52:53 +0000 (Wed, 02 Nov 2011) Log Message: ----------- Fixed bug. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-11-01 21:36:36 UTC (rev 3354) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-11-02 07:52:53 UTC (rev 3355) @@ -260,7 +260,7 @@ reasoner = new ReasonerFactory().createNonBufferingReasoner(ontology, conf); } else if (getReasonerTypeString().equals("pellet")) { // instantiate Pellet reasoner - reasoner = PelletReasonerFactory.getInstance().createNonBufferingReasoner(owlAPIOntologies.iterator().next(), conf); + reasoner = PelletReasonerFactory.getInstance().createNonBufferingReasoner(ontology, conf); // change log level to WARN for Pellet, because otherwise log // output will be very large Logger pelletLogger = Logger.getLogger("org.mindswap.pellet"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-11-01 21:36:42
|
Revision: 3354 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3354&view=rev Author: lorenz_b Date: 2011-11-01 21:36:36 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Solved problem with missing axioms, caused by missing import declarations. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-11-01 18:59:35 UTC (rev 3353) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-11-01 21:36:36 UTC (rev 3354) @@ -147,6 +147,8 @@ Set<OWLOntology> allImports = new HashSet<OWLOntology>(); prefixes = new TreeMap<String, String>(); + + Set<OWLImportsDeclaration> directImports = new HashSet<OWLImportsDeclaration>(); for (AbstractKnowledgeSource source : sources) { @@ -169,6 +171,7 @@ } owlAPIOntologies.add(ontology); + directImports.addAll(ontology.getImportsDeclarations()); try { // imports includes the ontology itself //FIXME this line throws the strange error @@ -227,6 +230,12 @@ } try { ontology = manager.createOntology(IRI.create("http://dl-learner/all"), new HashSet<OWLOntology>(owlAPIOntologies)); + //we have to add all import declarations manually here, because this are no axioms + List<OWLOntologyChange> addImports = new ArrayList<OWLOntologyChange>(); + for(OWLImportsDeclaration i : directImports){ + addImports.add(new AddImport(ontology, i)); + } + manager.applyChanges(addImports); } catch (OWLOntologyCreationException e1) { e1.printStackTrace(); } @@ -251,8 +260,7 @@ reasoner = new ReasonerFactory().createNonBufferingReasoner(ontology, conf); } else if (getReasonerTypeString().equals("pellet")) { // instantiate Pellet reasoner - reasoner = PelletReasonerFactory.getInstance().createNonBufferingReasoner(ontology, conf); - + reasoner = PelletReasonerFactory.getInstance().createNonBufferingReasoner(owlAPIOntologies.iterator().next(), conf); // change log level to WARN for Pellet, because otherwise log // output will be very large Logger pelletLogger = Logger.getLogger("org.mindswap.pellet"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-01 18:59:41
|
Revision: 3353 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3353&view=rev Author: jenslehmann Date: 2011-11-01 18:59:35 +0000 (Tue, 01 Nov 2011) Log Message: ----------- wrote unit test to reproduce and narrow down bug in NLP2RDF example Modified Paths: -------------- trunk/examples/father.conf trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf Added Paths: ----------- trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java Added: trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java (rev 0) +++ trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java 2011-11-01 18:59:35 UTC (rev 3353) @@ -0,0 +1,67 @@ +/** + * Copyright (C) 2007-2011, 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.test.junit; + +import static org.junit.Assert.*; + +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.Intersection; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.ObjectProperty; +import org.dllearner.core.owl.ObjectSomeRestriction; +import org.dllearner.core.owl.Thing; +import org.dllearner.kb.OWLFile; +import org.dllearner.reasoning.FastInstanceChecker; +import org.junit.Test; + +/** + * + * @author Jens Lehmann + * + */ +public class ReasonerTest { + + @Test + public void nlp2rdfTest() throws ComponentInitException { + // read file into reasoner + OWLFile file = new OWLFile("../examples/nlp2rdf/reuters_gold_vs_copper/positives.owl"); + file.init(); + FastInstanceChecker fic = new FastInstanceChecker(); + fic.setSources(file); + fic.init(); + + NamedClass doc = new NamedClass("http://nlp2rdf.lod2.eu/schema/string/Document"); + ObjectProperty op = new ObjectProperty("http://nlp2rdf.lod2.eu/schema/string/subStringTrans"); + ObjectSomeRestriction osr = new ObjectSomeRestriction(op,Thing.instance); + Intersection is = new Intersection(doc,osr); + + Individual ind = new Individual("http://nlp2rdf.org/POS/2/offset_0_763_COPPER+STUDY+GROUP+C"); + + // there should be several subStringTrans relations + assertFalse(fic.getRelatedIndividuals(ind, op).isEmpty()); + // individual should be member of this expression (required to learn the correct concept) + assertTrue(fic.hasType(is, ind)); + + // TODO: once this works, we need to make sure that "positives.owl" is in a "stable" directory + + } + +} Modified: trunk/examples/father.conf =================================================================== --- trunk/examples/father.conf 2011-11-01 16:01:42 UTC (rev 3352) +++ trunk/examples/father.conf 2011-11-01 18:59:35 UTC (rev 3353) @@ -16,7 +16,7 @@ // reasoner reasoner.type = "fast instance checker" -reasoner.sources = { ks } +reasoner.sources = { ks2 } // learning problem lp.type = "posNegStandard" @@ -25,3 +25,4 @@ // create learning algorithm to run alg.type = "ocel" + Modified: trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf =================================================================== --- trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-01 16:01:42 UTC (rev 3352) +++ trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-01 18:59:35 UTC (rev 3353) @@ -1,5 +1,10 @@ lp.positiveExamples = { -"http://nlp2rdf.org/POS/4/offset_0_837_TOTAL+U.S.+COPPER+ST","http://nlp2rdf.org/POS/6/offset_0_763_U.S.+REFINERY+COPPER","http://nlp2rdf.org/POS/3/offset_0_201_MAGMA+LOWERS+COPPER+","http://nlp2rdf.org/POS/2/offset_0_763_COPPER+STUDY+GROUP+C","http://nlp2rdf.org/POS/1/offset_0_840_COPPER+STOCKS+OUTSID","http://nlp2rdf.org/POS/5/offset_0_690_U.S.+BRASS+MILL+COPP" +"http://nlp2rdf.org/POS/4/offset_0_837_TOTAL+U.S.+COPPER+ST", +"http://nlp2rdf.org/POS/6/offset_0_763_U.S.+REFINERY+COPPER", +"http://nlp2rdf.org/POS/3/offset_0_201_MAGMA+LOWERS+COPPER+", +"http://nlp2rdf.org/POS/2/offset_0_763_COPPER+STUDY+GROUP+C", +"http://nlp2rdf.org/POS/1/offset_0_840_COPPER+STOCKS+OUTSID", +"http://nlp2rdf.org/POS/5/offset_0_690_U.S.+BRASS+MILL+COPP" } lp.negativeExamples = { "http://nlp2rdf.org/NEG/7/offset_0_691_CURRENCIES+COULD+INF","http://nlp2rdf.org/NEG/10/offset_0_847_REAGAN%27S+REMARKS+HEL","http://nlp2rdf.org/NEG/2/offset_0_1254_BELGIAN+ECU+COIN+ISS","http://nlp2rdf.org/NEG/6/offset_0_1657_CONSOLIDATED+TVX+TO+","http://nlp2rdf.org/NEG/9/offset_0_592_MORE+GOLD+DETECTED+A","http://nlp2rdf.org/NEG/3/offset_0_1754_BHP+TO+FLOAT+GOLD+UN","http://nlp2rdf.org/NEG/4/offset_0_1280_BLACK+MINERS+SUPPORT","http://nlp2rdf.org/NEG/1/offset_0_587_AMAX+%3CAMX%3E+IN+GOLD%2C+","http://nlp2rdf.org/NEG/8/offset_0_624_LAC+%3CLAC%3E+INTERSECTS","http://nlp2rdf.org/NEG/5/offset_0_621_CHINA%27S+HEILONGJIANG" @@ -28,4 +33,11 @@ op.useStringDatatypes = true //op.frequencyThreshold = 1 alg.type = "celoe" +alg.writeSearchTree = true +alg.replaceSearchTree = true +alg.maxExecutionTimeInSeconds = 100 +alg.maxNrOfResults = 100 + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-11-01 14:55:51
|
Revision: 3351 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3351&view=rev Author: lorenz_b Date: 2011-11-01 14:55:44 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Fixed problem. Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-11-01 14:08:09 UTC (rev 3350) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-11-01 14:55:44 UTC (rev 3351) @@ -256,6 +256,7 @@ if(i == maxTestedQueries){ break; } + i++; } //test candidates @@ -386,28 +387,31 @@ Set<WeightedQuery> tmp = new HashSet<WeightedQuery>(); for(Slot slot : t.getSlots()){ - for(Allocation a : slot2Allocations.get(slot)){ - for(WeightedQuery query : queries){ - if(slot.getSlotType() == SlotType.SYMPROPERTY){ - Query reversedQuery = new Query(query.getQuery()); - reversedQuery.getTriplesWithVar(slot.getAnchor()).iterator().next().reverse(); - reversedQuery.replaceVarWithURI(slot.getAnchor(), a.getUri()); - WeightedQuery w = new WeightedQuery(reversedQuery); + if(!slot2Allocations.get(slot).isEmpty()){ + for(Allocation a : slot2Allocations.get(slot)){ + for(WeightedQuery query : queries){ + if(slot.getSlotType() == SlotType.SYMPROPERTY){ + Query reversedQuery = new Query(query.getQuery()); + reversedQuery.getTriplesWithVar(slot.getAnchor()).iterator().next().reverse(); + reversedQuery.replaceVarWithURI(slot.getAnchor(), a.getUri()); + WeightedQuery w = new WeightedQuery(reversedQuery); + double newScore = query.getScore() + a.getScore(); + w.setScore(newScore); + tmp.add(w); + } + Query q = new Query(query.getQuery()); + q.replaceVarWithURI(slot.getAnchor(), a.getUri()); + WeightedQuery w = new WeightedQuery(q); double newScore = query.getScore() + a.getScore(); w.setScore(newScore); tmp.add(w); } - Query q = new Query(query.getQuery()); - q.replaceVarWithURI(slot.getAnchor(), a.getUri()); - WeightedQuery w = new WeightedQuery(q); - double newScore = query.getScore() + a.getScore(); - w.setScore(newScore); - tmp.add(w); } + queries.clear(); + queries.addAll(tmp); + tmp.clear(); } - queries.clear(); - queries.addAll(tmp); - tmp.clear(); + } for(WeightedQuery q : queries){ q.setScore(q.getScore()/t.getSlots().size()); @@ -465,6 +469,7 @@ return cnt; } + private Map<Template, Collection<? extends Query>> getSPARQLQueryCandidates(Set<Template> templates){ logger.info("Generating candidate SPARQL queries..."); mon.start(); @@ -926,10 +931,11 @@ // Logger.getLogger(DefaultHttpParams.class).setLevel(Level.OFF); // Logger.getLogger(HttpClient.class).setLevel(Level.OFF); // Logger.getLogger(HttpMethodBase.class).setLevel(Level.OFF); - String question = "Give me all films produced by Hal Roach?"; +// String question = "In which programming language is GIMP written?"; + String question = "Who/WP are/VBP the/DT presidents/NNS of/IN the/DT United/NNP States/NNPS"; // String question = "Give me all books written by authors influenced by Ernest Hemingway."; - SPARQLTemplateBasedLearner learner = new SPARQLTemplateBasedLearner(); + SPARQLTemplateBasedLearner learner = new SPARQLTemplateBasedLearner();learner.setUseIdealTagger(true); // SparqlEndpoint endpoint = new SparqlEndpoint(new URL("http://greententacle.techfak.uni-bielefeld.de:5171/sparql"), // Collections.<String>singletonList(""), Collections.<String>emptyList()); SparqlEndpoint endpoint = new SparqlEndpoint(new URL("http://greententacle.techfak.uni-bielefeld.de:5171/sparql"), @@ -939,7 +945,7 @@ learner.learnSPARQLQueries(); System.out.println("Learned query:\n" + learner.getBestSPARQLQuery()); System.out.println("Lexical answer type is: " + learner.getTemplates().iterator().next().getLexicalAnswerType()); - + } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-11-01 14:08:19
|
Revision: 3350 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3350&view=rev Author: lorenz_b Date: 2011-11-01 14:08:09 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Added limit for max tested queries. Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-11-01 13:48:33 UTC (rev 3349) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-11-01 14:08:09 UTC (rev 3350) @@ -79,6 +79,8 @@ private int maxTestedQueriesPerTemplate = 50; private int maxQueryExecutionTimeInSeconds; + private int maxTestedQueries = 200; + private SparqlEndpoint endpoint = SparqlEndpoint.getEndpointDBpediaLiveAKSW(); private ExtractionDBCache cache = new ExtractionDBCache("cache"); @@ -248,8 +250,12 @@ //get the weighted query candidates Set<WeightedQuery> weightedQueries = getWeightedSPARQLQueries(templates); sparqlQueryCandidates = new ArrayList<Query>(); + int i = 0; for(WeightedQuery wQ : weightedQueries){ sparqlQueryCandidates.add(wQ.getQuery()); + if(i == maxTestedQueries){ + break; + } } //test candidates This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-11-01 13:48:42
|
Revision: 3349 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3349&view=rev Author: lorenz_b Date: 2011-11-01 13:48:33 +0000 (Tue, 01 Nov 2011) Log Message: ----------- fixed problem. Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-11-01 13:31:55 UTC (rev 3348) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-11-01 13:48:33 UTC (rev 3349) @@ -407,6 +407,11 @@ q.setScore(q.getScore()/t.getSlots().size()); } allQueries.addAll(queries); + List<Query> qList = new ArrayList<Query>(); + for(WeightedQuery wQ : queries){ + qList.add(wQ.getQuery()); + } + template2Queries.put(t, qList); } return allQueries; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2011-11-01 13:27:16
|
Revision: 3347 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3347&view=rev Author: kurzum Date: 2011-11-01 13:27:07 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Added Paths: ----------- trunk/examples/nlp2rdf/reuters_gold_vs_copper/ trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf trunk/examples/nlp2rdf/reuters_gold_vs_copper/negatives.owl trunk/examples/nlp2rdf/reuters_gold_vs_copper/positives.owl trunk/examples/nlp2rdf/reuters_gold_vs_copper/sso.owl trunk/examples/nlp2rdf/reuters_gold_vs_copper/string.owl Added: trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf =================================================================== --- trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf (rev 0) +++ trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-01 13:27:07 UTC (rev 3347) @@ -0,0 +1,31 @@ +lp.positiveExamples = { +"http://nlp2rdf.lod2.eu/nif/offset_0_763_U.S.+REFINERY+COPPER","http://nlp2rdf.lod2.eu/nif/offset_0_690_U.S.+BRASS+MILL+COPP","http://nlp2rdf.lod2.eu/nif/offset_0_201_MAGMA+LOWERS+COPPER+","http://nlp2rdf.lod2.eu/nif/offset_0_763_COPPER+STUDY+GROUP+C","http://nlp2rdf.lod2.eu/nif/offset_0_837_TOTAL+U.S.+COPPER+ST","http://nlp2rdf.lod2.eu/nif/offset_0_840_COPPER+STOCKS+OUTSID" +} +lp.negativeExamples = { +"http://nlp2rdf.lod2.eu/nif/offset_0_587_AMAX+%3CAMX%3E+IN+GOLD%2C+","http://nlp2rdf.lod2.eu/nif/offset_0_621_CHINA%27S+HEILONGJIANG","http://nlp2rdf.lod2.eu/nif/offset_0_1254_BELGIAN+ECU+COIN+ISS","http://nlp2rdf.lod2.eu/nif/offset_0_691_CURRENCIES+COULD+INF","http://nlp2rdf.lod2.eu/nif/offset_0_1754_BHP+TO+FLOAT+GOLD+UN","http://nlp2rdf.lod2.eu/nif/offset_0_624_LAC+%3CLAC%3E+INTERSECTS","http://nlp2rdf.lod2.eu/nif/offset_0_592_MORE+GOLD+DETECTED+A","http://nlp2rdf.lod2.eu/nif/offset_0_847_REAGAN%27S+REMARKS+HEL","http://nlp2rdf.lod2.eu/nif/offset_0_1280_BLACK+MINERS+SUPPORT","http://nlp2rdf.lod2.eu/nif/offset_0_1657_CONSOLIDATED+TVX+TO+" +} + + +str.type = "OWL File" +str.fileName = "string.owl" +sso.type = "OWL File" +sso.fileName = "sso.owl" + +pos.type = "OWL File" +pos.fileName = "positives.owl" +neg.type = "OWL File" +neg.fileName = "negatives.owl" +reasoner.type = "fast instance checker" +reasoner.sources = { str, sso, pos, neg } +lp.type = "posNegStandard" +op.type = "rho" +op.useNegation = false +op.useAllConstructor = false +op.useCardinalityRestrictions = false +op.useHasValueConstructor = true +op.useDataHasValueConstructor = true +op.reasoner = reasoner +op.useStringDatatypes = true +//op.frequencyThreshold = 1 +alg.type = "celoe" + Added: trunk/examples/nlp2rdf/reuters_gold_vs_copper/negatives.owl =================================================================== --- trunk/examples/nlp2rdf/reuters_gold_vs_copper/negatives.owl (rev 0) +++ trunk/examples/nlp2rdf/reuters_gold_vs_copper/negatives.owl 2011-11-01 13:27:07 UTC (rev 3347) @@ -0,0 +1,63562 @@ +<rdf:RDF + xmlns:j.0="http://purl.org/olia/stanford.owl#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:j.1="http://purl.org/olia/penn-syntax.owl#" + xmlns:str="http://nlp2rdf.lod2.eu/schema/string/" + xmlns:j.2="http://purl.org/olia/system.owl#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:sso="http://nlp2rdf.lod2.eu/schema/sso/" + xmlns:j.3="http://purl.org/olia/olia.owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:j.4="http://purl.org/olia/penn.owl#" + xmlns:j.5="http://purl.org/olia/olia-top.owl#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> + <owl:Ontology rdf:about="file://something/negatives"> + <owl:imports rdf:resource="http://nlp2rdf.lod2.eu/schema/string/"/> + <owl:imports rdf:resource="http://nlp2rdf.lod2.eu/schema/sso/"/> + </owl:Ontology> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Residual"> + <rdfs:comment> + The residual value (R) is assigned to classes of text words which lie outside the + traditionally accepted range of grammatical classes, although they occur quite + commonly in many texts and very commonly in some. For example: foreign words, + or mathematical formulae. It can be argued that these are on the fringes of the + grammar or lexicon of the language in which the text is written. Nevertheless, + they need to be tagged. (http://www.ilc.cnr.it/EAGLES96/annotate/node16.html#mr 19.09.06) + + Although words in the Residual category are on the periphery of the lexicon, they may + take some of the grammatical characteristics, e.g., of nouns. Acronyms such as IBM are + similar to proper nouns; symbols such as alphabetic characters can vary for singular and + plural (e.g. How many Ps are there in `psychopath'?), and are in this respect like common + nouns. In some languages (e.g. Portuguese) such symbols also have gender. It is quite + reasonable that in some tagging schemes some of these classes of word will be classified + under other parts of speech. (The Unclassified category applies to word-like text segments + which do not easily fit into any of the foregoing values. For example: incomplete words + and pause fillers such as er and erm in transcriptions of speech, or written representations of singing such as dum-de-dum. (http://www.ilc.cnr.it/EAGLES96/annotate/node17.html#recr 19.09.06)</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Conjunction"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + </rdfs:subClassOf> + <rdfs:comment> + A conjunction is a word that syntactically links words or larger constituents, + and expresses a semantic relationship between them. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAConjunction.htm 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#LinguisticConcept"> + <rdfs:comment>The OLiA ontology specifies linguistic concepts on a theoretical basis, as for concepts used in annotations, see system.owl. +There is a great extent of overlap between LinguisticCategories/LinguisticFeatures and Categories/Features as defined in system.owl.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://www.w3.org/2002/07/owl#Thing"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#WHPrepositionalPhrase"> + <rdfs:comment>WHPP|Wh-prepositional phrase. Prepositional phrase containing a wh-determiner, as in by whatever +means necessary. +(Santorini 1991) + +WHPP â ´ Wh-prepositional Phrase. Prepositional phrase containing a wh-noun phrase (such as of which or by whose authority) that either introduces a PP gap or is contained by a WHNP. +(Bies et al. 1995)</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PrepositionalPhrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#VerbPhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#VerbPhrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:comment>VP|Verb phrase. Phrasal category headed a verb. +(Santorini 1991) + +VP — Verb Phrase. Phrasal category headed a verb. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/system.owl#LinguisticAnnotation"> + <rdfs:comment>Linguistic annotations pertain to either structural entities (words, tokens, constituents, sentences => UnitOfAnnotation), relations between these (dependency, dominance, coreference, etc. => Relation), or grammatical features attached to these (case, gender, number, agreement, tense, mood, aspect, ... => Feature).</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AuxiliaryVerb"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment> + An auxiliary verb is a verb which accompanies the lexical verb of a verb phrase, + and expresses grammatical distinctions not carried by the lexical verb, such as + person, number, tense aspect, and voice. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAnAuxiliaryVerb.htm 19.09.06) + + Besides modal verbs ("semiauxiliary") and "strict" auxiliary verbs, also copulas + are classified under auxiliary verbs here, as this is a praxis applied in practically every + EAGLES-conformant morphosyntactic annotation scheme. + + Part of speech referring to the set of verbs, subordinate to the main lexical verb which help + to make distinction in mood, aspect, voice etc. + (Crystal 2003; http://www.isocat.org/datcat/DC-1244) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#WHPronoun"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Pronoun"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#To"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:comment>"To" is tagged TO, regardless of whether it is a preposition or an infinitival marker.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"> + <rdfs:label>word</rdfs:label> + <rdfs:comment> + SyntacticWord is the class of syntactic units occupying the lowest position in + a syntactic construction. They are the largest units resistant to insertion of + new constituents within their boundaries; or they are the smallest constituents + that can be moved within a sentence without making the sentence ungrammatical. + (http://www.linguistics-ontology.org/gold/2008/SyntacticWord) + + Linguistic unit composed of at least a part of speech and a lemma. + (Gil Francopoulo; http://www.isocat.org/datcat/DC-1415) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#CoordinatingConjunction"> + <rdfs:comment> + Coordinating conjunctions, also called coordinators, are conjunctions that + join two items of equal syntactic importance. + (http://en.wikipedia.org/wiki/Grammatical_conjunction 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Conjunction"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PrepositionalPhrase"> + <rdfs:comment> + A sequence of a preposition and its complement is a prepositional phrase. The complement of a preposition is usually + a noun phrase (see examples 38 to 40), but may also be a clause or an adverb phrase. According to the categories + recommended here, a prepositional phrase may be analysed further into preposition and noun phrase. The examples + below demonstrate how this further analysis can be a recursive procedure. + + (38) [PP en [NP sustitucion [PP de [NP los canales correspondientes [PP de [NP 50 baudios NP] PP] NP] PP] NP] PP]. + (39) [NP Fairbanks NP] [VP hummed [NP a few bars NP] VP] [PP in [NP a voice [VP made resonant + [PP by [NP the very weakness [PP of [NP his chest NP] PP] NP] PP] VP] NP] PP]. + (40) [PP En [NP el caso [PP de [NP un sistema mixto [PP en [NP el + [CL que [VP se utilicen [NP canales [PP con [NP tres velocidades + [PP de [NP modulacion NP] PP] diferentes NP] PP] NP] VP] CL] NP] PP] NP] PP] NP] PP] + + In a language such as Spanish, where a large proportion of the modification of nouns takes the form of a following + preposition de and another noun, this recursion is extremely prevalent, as in 40. In cases where the prepositional + phrase is complemented by a one word noun phrase, it may be advantageous to leave the analysis at this point, rather + than continuing to analyse further by enclosing the complement (see also one-word constituents). + + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node34.html#SECTION00052500000000000000) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounHeadedPhrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#NounPhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounPhrase"/> + </rdfs:subClassOf> + <rdfs:comment>NP|Noun phrase. Phrasal category that includes all constituents that depend on a head noun. +(Santorini 1991) + +NP — Noun Phrase. Phrasal category that includes all constituents that depend on a head noun. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#WhPronoun"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Pronoun"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#WHPronoun"/> + <rdfs:comment>This category includes "what", "who" and "whom".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Present"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AbsoluteTense"/> + </rdfs:subClassOf> + <rdfs:comment> + Present tense refers to the moment of utterance. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#presentTense) + + Present tense refers to the moment of utterance. + It often refers to events or states that do not merely coincide + with the moment of utterance, such as those that are continuous, + habitual, or lawlike. + (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsPresentTense.htm 17.11.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#GerundOrPresentParticiple"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ing"/> + </rdfs:subClassOf> + <rdfs:comment>This is a verb in present participle or in gerund.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Plural"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#NumberFeature"/> + </rdfs:subClassOf> + <rdfs:comment> + Plural is a grammatical number, typically referring to more than one of + the referent in the real world. In English, nouns, pronouns, and demonstratives + inflect for plurality. In many other languages, for example German and the + various Romance languages, articles and adjectives also inflect for plurality. + (http://en.wikipedia.org/wiki/Plural 17.11.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Clause"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SyntaxTag"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Clause"/> + </rdfs:subClassOf> + <rdfs:comment>We distinguish among a number of basic clause types: S, SINV, SBAR, RRC, SBARQ, SQ, S-CLF, it-extraposition, and FRAG. +(Bies et al. 1995) + +S-CLF is @cat="S" & edge/@func="CLF", so see under ItCleft</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Constituent"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"/> + </rdfs:subClassOf> + <rdfs:comment> + Constituents correspond to a GOLD SyntacticConstruction: + SyntacticConstruction is the class of grammar units that + have syntactic structure, i.e., consisting of more than + one syntactic word or construction in a syntactic + configuration. [Crystal 1980, 85-86]. + (http://www.linguistics-ontology.org/gold/2008) + + Corresponds to units of annotation in the EAGLES recommendations for syntactic annotation + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node29.html#SECTION00052000000000000000) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Adjective"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:comment> + An Adjective is a noun-modifying expression that specifies the properties or attributes of the nominal referent. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAnAdjective.htm 18.9.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Gerund"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NonFiniteVerb"/> + </rdfs:subClassOf> + <rdfs:comment> + property for a non-finite form of a verb other than the infinitive. + (http://www.isocat.org/datcat/DC-2243) + + A gerund is a kind of verbal noun that exists in some languages. In today's English, + gerunds are nouns built from a verb with an '-ing' suffix. They can be used as the + subject of a sentence, an object, or an object of preposition. They can also be used + to complement a subject. Often, gerunds exist side-by-side with nouns that come from + the same root but the gerund and the common noun have different shades of meaning. + (http://en.wikipedia.org/wiki/Gerund, http://en.wikibooks.org/wiki/English:Gerund 19.09.06) + + The term _gerund_ is ambiguous: with respect to Latin, in whose grammatical tradition it originates, it refers to a deverbal noun, and is needed in this function for Polish as well; in descriptions of some other languages, however, it has been used for an adverbial participle. + The two meanings have nothing in common, except that the English _ing_-form can translate both. (Ivan A Derzhanski, email 2010/06/09) + Here, it is assumed that Gerund refers only to deverbal nouns, cf. NominalNonfiniteVerb in the IIIT tagset (http://purl.org/olia/iiit.owl#NominalNonFiniteVerb) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#BePastTense"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment>This category includes the conditional form of the verb to be. +EXAMPLES: +If I were/VBD rich... +If I were/VBD to win the lottery...</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#VerbPhrase"> + <rdfs:comment> + This category is slightly more difficult to define, since there is disagreement over the extent of the verb phrase. + In particular, should the verb phrase include only the words that are verbs, or should it also include the + complements of the verb? In the examples given in this document, and in the sample texts in the appendices, we have + chosen to include the complements, but it must be noted that this is an open issue, and we are in no way implying + that this analysis is preferable to the alternative. The choice to be made at this level, i.e. the inclusion or + exclusion of verbal complements in the Verb Phrase, is shown by the examples in 27 and 28, 27 showing the inclusion + of the complement of the verb in the verb phrase and 28 excluding the complement: + + (27) He [VP took up [NP a clothes brush NP] VP] + (28) He [VP took up VP] [NP a clothes brush NP] + + An advantage in the type of analysis shown in 27 is that the relative levels of the constituents can be shown to a + greater extent -- i.e. complements of the verb are included in the verb phrase, while adjuncts and peripheral + adverbials are left at sentence level. + + However, in a case where an adjunct occurs before the complement of the verb, the approaches used in 27 and 28 would + cause problems, since either both the adjunct and the complement would be included as daughters of the verb phrase, + or both would be daughters of the sentence, rather than keeping the complement as a daughter of the verb phrase and + the adjunct as a sister of the verb phrase. These problems may be solved by an additional notation, but at some + level, arbitrariness is inevitable. + + Regardless of the choice made over the extent of the Verb Phrase, there arises a problem of discontinuous Verb + Phrases. A complex verbal construction may be discontinuous, e.g. the auxiliary and the main verb are separated in + inverted constructions in English, or the main verb is positioned at the end of the sentence in German and Dutch. + Such discontinuity can be avoided by having different labels and constituents for the auxiliary verb and the main + verb, resulting in an analysis as shown in the Dutch example 29 below: + + (29) [NP Ze NP] [AUX zullen AUX] [ADVP er ADVP] [VP [NP de VN-agenda + [PP voor [NP het komende jaar NP] PP] NP] behandelen VP]. + + and in the English interrogative inverted example 30, using the so-called `dummy auxiliary' do: + + (30) [AUX Do AUX] [NP they NP] [VP confide [PP in you PP] VP]? + + As with Noun Phrases, Verb Phrases can be identified by a constituency test. In strong constituency languages like + English, the whole VP can be moved, but not part of it: compare 31 and 32: + + (31) Give in to blackmail, I never will + (32) *Give in, I never will to blackmail + + However, there are languages in which constituent tests do not work. These will typically be languages with flexible + word order, such as Finnish. 33 is an example of a discontinuous VP (Vilkuna 1989: 26): + + (33) Maailmaa nähnyt hän on. + world-Part seen he is + `He IS a widely-travelled person.' + + For Finnish, then, evidence for a VP is less convincing than it is for English, and a dependency approach seems the + more natural choice. (Covington (1990) provides a parsing strategy for variable word order languages and Covington + (1991) for parsing discontinuous constituents, both using a dependency syntax approach.) + + In Italian also, constituency tests cannot be applied. This can be shown through the distribution of VP-adverbs + (e.g. completamente `completely', intenzionalmente `intentionally', attentamente `carefully') and S-adverbs (e.g. + probabilmente `probably', certamente `certainly'). In English, these different classes of adverbs have a different + distribution within the sentence. In contrast, in Italian, the distinct adverb classes cannot be distinguished on + the basis of their distribution in the sentence. S-adverbs and VP-adverbs can occur in the same positions within the + sentence, as illustrated in examples 34 to 37: + + (34) Attentamente/certamente, il bambino ascoltó la storia + `Carefully/certainly, the child listened to the story' + (35) Il bambino attentamente/certamente ascoltó la storia + `The child carefully/certainly listened to the story' + (36) Il bambino ascoltó attentamente/certamente la storia + `The child listened carefully/certainly to the story' + (37) Il bambino ascoltó la storia attentamente/certamente + `The child listened to the story carefully/certainly' + + Thus, in Italian as well as other languages, neither the position nor the syntactic context can help to decide + whether an adverb is an S-adverb or a VP-adverb; this can only be stated by considering its semantic content and the + way it relates to the content of the predicate or the sentence. This situation has consequences for the success of + standard VP-tests. + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node33.html) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Phrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#SecondaryPunctuation"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Punctuation"/> + </rdfs:subClassOf> + <rdfs:comment> + Punctuation that is not very important with regards to sentence splitting in a text. + (http://www.isocat.org/datcat/DC-2076) + </rdfs:comment> + <rdfs:label>secondary punctuation</rdfs:label> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Noun"> + <rdfs:comment>We inserted this class 'noun' to get a clearer ontology structure. In The Penn Treebank Tag Set there is no class 'noun'.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Noun"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#AdverbPhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AdverbPhrase"/> + </rdfs:subClassOf> + <rdfs:comment>ADVP|Adverb phrase. Phrasal category headed by an adverb (including comparative and superlative +adverbs). Examples: rather timidly, very well indeed. +(Santorini 1991) + +ADVP — Adverb Phrase. Phrasal category headed by an adverb (including comparative and superlative adverbs). Examples: rather timidly, very well indeed, rapidly. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Adverb"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Adverb"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:comment>This category includes most words that end in -ly as well as degree words like "quite", "too" and "very", posthead modifiers like "enough" and "indeed" (as in "good enough", "very well indeed"), and negative markers like "not", "n' t" and "never".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#ComparativeAdjective"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Adjective"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Comparative"/> + </rdfs:subClassOf> + <rdfs:comment>These are adjectives mostly with the comparative ending -er and a comparative meaning. "More" or "less" should be tagged as a comparative adjective when it is used without a head noun and it +corresponds to the object of a verb or preposition.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PossessivePronoun"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Pronoun"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PossessivePronoun"/> + </rdfs:subClassOf> + <rdfs:comment>Both substitutive and attributive 'her' are covered by this categorie. It's thus PossessiveDeterminer or PossessivePronoun.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Determiner"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PronounOrDeterminer"/> + </rdfs:subClassOf> + <rdfs:comment> + A determiner is a noun modifier that expresses the reference of a noun or noun phrase + in the context, including quantity, rather than attributes expressed by adjectives. + This part of speech is defined in some languages, such as in English, as it is distinct + from adjectives grammatically, though most English dictionaries still identify the + determiners as adjectives. + (http://en.wikipedia.org/wiki/Determiner 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#CaseFeature"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </rdfs:subClassOf> + <rdfs:comment>Case is a grammatical category determined by the syntactic or semantic function of a noun or pronoun. The term case has traditionally been restricted to apply to only those languages which indicate certain functions by the inflection of nouns, pronouns, or noun phrase constituents, such as adjectives and numerals. (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsCase.htm 17.11.06)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#ComparativeAdverb"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Comparative"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Adverb"/> + <rdfs:comment>These are comparative adverbs.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#ForeignWord"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Foreign"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:comment>These are foreign words.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Pronoun"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PronounOrDeterminer"/> + </rdfs:subClassOf> + <rdfs:comment> + A pronoun is a pro-form which functions like a noun and substitutes for a + noun or a noun-phrase. A language may have several classes of pronouns. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAPronoun.htm 19.09.06) + + A pronominal is a phrase that functions as a pronoun + (www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAPronominal.htm; http://www.isocat.org/datcat/DC-1369) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Clause"> + <rdfs:comment> + Traditionally sentences are deemed to be composed of major constituents + known as clauses, which may be main clauses (not included in a superordinate + clause) or embedded clauses (included in a superordinate clause) such as + relative clauses or adverbial clauses. A main clause, unless it is coordinated, + is equivalent to a simple sentence, and does not need to be separately labelled. + Embedded and coordinated clauses, on the other hand, will need to be separately + identified. We recommend that such units be identified in the annotation, and + labelled either as sentences (S) or as clauses (CL), according to the preference + specified in the annotation scheme. + + The reason for allowing choice here is that different theoretical preferences + have to be accommodated. In some syntactic models, the `clause' category is not + used (except informally), embedded clauses being marked by included [S] + constituents. In other models, clauses are identified as such, even where they + are coextensive with an independent sentence. + + One solution which commends itself (and is employed in the Lancaster Treebank and + the SUSANNE Corpus) is to retain [S ... S] as the delimiter of sentences, whether + included or not, and also to use [S ... S] for the coordinated parts of a compound + sentence; but to use `clause' labels for subordinate clauses. An example which + illustrates this division is 12: + + (12) [S [S The distinction at issue is relatively clear S] , but [S closer + examination reveals [CL that all is not quite so straightforward + [CL as it seems CL] CL] S] . S] + + Embedded (subordinate) clauses are generally identified by some sign of their + dependence on the superordinate clause or sentence, such as an introductory + conjunction or a non-finite verb form. It is noticeable that the coordinated + parts of the compound sentence do not have to be clause-like units with subjects + and verbs, and to this extent [CL] would be a misleading label to apply to them. + This is true, in 13, of so far so good in: + + (13) [S [S So far so good S] , but [S now consider gender in adjectives S] . S] + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node31.html) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Constituent"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/system.owl#Feature"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#LinguisticConcept"/> + <rdfs:comment>Morphosyntactic and morphological features.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Noun"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:comment> + A noun, or noun substantive, is a part of speech (a word or phrase) which can co-occur with + (in)definite articles and attributive adjectives, and function as the head of a noun phrase. + + The word "noun" derives from the Latin 'nomen' meaning "name", and a traditional definition + of nouns is that they are all and only those expressions that refer to a person, place, + thing, event, substance, quality, idea or an appointment. They serve as the subject or object + of a verb, and the object of a preposition. + (http://en.wikipedia.org/wiki/Noun 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#SubordinateClause"> + <rdfs:comment> + SubordinateClause is the class of clauses that cannot stand on their + own as sentences. A matrix clause combined with a subordinate clause + form a main clause. In the sentence 'John thinks that Mary is sick', + 'Mary is sick' is the subordinate clause. + (http://purl.org/linguistics/gold/SubordinateClause) + + Dependent clauses (which are also sometimes referred to as subordinate + clauses) cannot stand alone as sentences. They usually begin with + subordinating conjunctions. A sentence with an independent clause and + any number of dependent clauses is referred to as a complex sentence. + One with two or more independent clauses and any number of dependent + clauses is referred to as a compound-complex sentence + (http://en.wikipedia.org/wiki/Clause, cf. + http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#subordinateClause). + + A subordinate clause is an embedded construction which contains a finite verb form. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#finiteEmbeddedConstruction) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#FiniteClause"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PossessivePronoun"> + <rdfs:comment> + A possessive pronoun is a pronoun that expresses relationships like ownership, such as kinship, and other forms of association. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAPossessivePronoun.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Pronoun"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/system.owl#LinguisticAnnotation"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PersonalPronoun"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Pronoun"/> + </rdfs:subClassOf> + <rdfs:comment>This category includes the personal pronouns proper, without regard for case distinctions ("I", "me", "you", "he", "him", etc.), the reflexive pronouns ending in -self or -selves, and the nominal possessive pronouns "mine", "yours", "his", "hers", "ours" and "theirs".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Punctuation"> + <rdfs:comment> + Punctuation marks (PU) are treated here as a part of morphosyntactic annotation, as it + is very common for punctuation marks to be tagged and to be treated as equivalent to + words for the purposes of automatic tag assignment. + (http://www.ilc.cnr.it/EAGLES96/annotate/node16.html#mp 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"> + <rdfs:comment>(Bies et al. 1995, §2.1.2)</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SyntaxTag"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Adjective"> + <rdfs:comment>These are adjectives, ordinal numerals, and ordinal numbers. +Hyphenated compounds that are used as modifiers are tagged as adjectives, e.g. "happy-go-lucky", "one-of-a-kind", "run-of-the-mill". Ordinal numbers are tagged as adjectives, as are compounds of the form "n-th" or "X-est", like "fourth-largest".</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Adjective"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ProperNoun"> + <rdfs:comment> + Proper nouns (also called proper names) are the names of unique entities. + (http://en.wikipedia.org/wiki/Noun 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Noun"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Numeral"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Quantifier"/> + </rdfs:subClassOf> + <rdfs:comment> + A numeral is a word, functioning most typically as an adjective or pronoun, + that expresses a number, and relation to the number, such as one of the + following: Quantity, Sequence, Frequency, Fraction. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsANumeral.htm 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#QuantifierPhrase"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn-syntax.owl#Phrase"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Quantifier"/> + </rdfs:subClassOf> + <rdfs:comment>QP +— Quantifier Phrase (i.e., complex measure/amount phrase); used within NP. (see section 11 [Modification of NP]) ... +This label is not used for NPs with quantificational determiners such as every, some, almost all, etc. Instead, it is used for multiword numerical expressions that occur within NP (and sometimes ADJP), where the QP corresponds frequently to some kind of complex determiner phrase. + +The determiners a and an are included in the QP in cases where the appropriate interpretation is one: + + (NP (QP under an) hour) + + (NP (QP less than a) year) + +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#CoordinatingConjunction"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Conjunction"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#CoordinatingConjunction"/> + <rdfs:comment>This category includes "and", "but", "nor", "or", "yet" (as in "Yet it's cheap", "cheap yet good"), as well as the mathematical operators "plus", "minus", "less", "times" (in the sense of "multiplied by") and "over" (in the sense of "divided by"), when they are spelled out. +For in the sense of "because" is a coordinating conjunction.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Determiner"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:comment>Not clear whether this corresponds to OLiA/EAGLES determiners, because some predeterminers seem to be adverbs rather than determiners proper.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#WhAdverb"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Adverb"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#WHTypeAdverbs"/> + </rdfs:subClassOf> + <rdfs:comment>This category includes "how", "where", "why", etc. When in a temporal sense is tagged as wh-adverb. In the sense of "if", on the other hand, it is a subordinating conjunction. +EXAMPLES: +"When/WRB he finally arrived, I was on my way out."</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounHeadedPhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:comment> + A NounHeadedPhrase takes a nominal as its (semantic) head. + Introduced as a generalization over NounPhrase and PrepositionalPhrase for reasons of consistency with dependency parsers like + Connexor where this differentiation is not made. + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ing"> + <rdfs:comment>English verb forms ending in '-ing' that represent either Gerunds or Participles.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Participle"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Gerund"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Particle"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Unique"/> + </rdfs:subClassOf> + <rdfs:comment>synonym of Unique, to be avoided because of its divergent definitions (Chiarcos)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#FiniteClause"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Clause"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AdjectivePhrase"> + <rdfs:comment> + An adjective phrase may consist of an adjective, or a sequence of words in which an adjective is the head of the + phrase, as shown in 47 to 50 below. + + (47) [NP his [ADJP surprisingly thick and hairy ADJP] wrists NP] + (48) [NP some [ADJP [ADJP wholly unanticipated ADJP] but [ADJP remotely possible ADJP] ADJP] event NP] + (49) [S [NP His speeches NP] [VP are [ADVP always ADVP] [ADJP too long [PP for comfort PP] ADJP] VP] S] + (50) [AUX have AUX] [NP you NP] [VP found [NP something + [ADJP suitable [PP for [NP your needs NP] PP] ADJP] NP] VP] ? + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node36.html) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Phrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#WHNounPhrase"> + <rdfs:comment>WHNP|Wh-noun phrase. Noun phrase containing (among other things) a wh-determiner, as in which +book or whose daughter, or consisting of a wh-pronoun like who. +(Santorini 1991) + +WHNP +â ´ Wh-noun Phrase. Introduces a clause with an NP gap. May be null (containing the 0 complementizer) or lexical, containing some wh-word, e.g. who, which book, whose daughter, none of which, or how many leopards. +(Bies et al. 1995)</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounPhrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#SuperlativeAdjective"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Adjective"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Superlative"/> + </rdfs:subClassOf> + <rdfs:comment>These are adjectives with the superlative ending -est (as well as "worst"). "Most" and "least" can also be tagged as superlative adjective when they occur by themselves.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#ExistentialThere"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ExistentialParticle"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:comment>Existential "there" is the unstressed "there" that triggers inversion of the inflected verb and the logical subject of a sentence, e.g. "There/EX was a party in progress.", "There/EX ensued a melee.".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#PersonFeature"> + <rdfs:comment>The grammatical person is deictic reference to the participant role of a referent, such as the speaker, the addressee, and others. Grammatical person typically defines a language's set of personal pronouns. It also frequently affects verbs, sometimes nouns, and possessive relationships as well. (http://en.wikipedia.org/wiki/Grammatical_person 17.11.06) + + Indication of grammatical person (1st, 2nd, 3rd, etc.) associated with a given inflected form. + (ISO12620; http://www.isocat.org/datcat/DC-1328) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Adverb"> + <rdfs:comment> + An adverb is a part of speech that serves to modify non-nominal parts of speech, + i.e., verbs, adjectives (including numbers), clauses, sentences and other adverbs. + Modifiers of nouns are primarily determiners and adjectives. + (http://en.wikipedia.org/wiki/Adverbs 18.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PrepositionOrSubordinatingConjunction"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Conjunction"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:comment>We make no explicit distinction between prepositions and subordinating conjunctions. (The distinction is not lost, however - a preposition is an IN that precedes a noun phrase or a prepositional phrase, and a subordinate conjunction is an IN that precedes a clause). +The preposition "to" has its own special tag TO.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#WHTypeAdverbs"> + <rdfs:comment> + Adverb that serves to express interrogativity, exclamation or that serves to link a subordinate clause to the matrix clause. + (Ch. Chiarcos) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Adverb"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#PrepositionalPhrase"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn-syntax.owl#Phrase"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#PrepositionalPhrase"/> + <rdfs:comment>PP|Prepositional_phrase. Phrasal_category_headed_by_a_preposition. +(Santorini 1991) + +PP — Prepositional Phrase. Phrasal category headed by a preposition. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#WHDeterminer"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Determiner"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#TenseFeature"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + <rdfs:comment>Tense is a grammatical category, typically marked on the verb, that deictically refers to the time of the event or state denoted by the verb in relation to some other temporal reference point. (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsTense.htm 17.11.06)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#CardinalNumber"> + <rdfs:comment> + A cardinal numeral is a numeral of the class whose members are considered basic + in form, used in counting, and used in expressing how many objects are referred to. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsACardinalNumeral.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Numeral"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#CardinalNumber"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#CardinalNumber"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:comment>These are cardinal numbers.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#DegreeFeature"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + <rdfs:comment>The Eagles-recommended attribute Degree applies only to inflectional comparatives and superlatives. In some languages, e.g. Spanish, the number of such adjectives is very small. (http://www.ilc.cnr.it/EAGLES96/annotate/node17.html#recn)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NonFiniteVerb"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment> + Verb forms occurring on their own only in dependent clauses and lacking tense and mood contrasts. + (adapted from Crystal 2003; http://www.isocat.org/datcat/DC-1332) + + A non-finite verb is a verb that is not fully inflected for categories that are marked inflectionally in a language, + such as the following: Tense, Aspect, Modality, Number, Person. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsANonfiniteVerb.htm 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Conjunction"> + <rdfs:comment>This class was inserted to reflect the tag structure. It does not, + however, exactly correspond to olia:Conjunction, because Penn conjunction + tags can also be applied to prepositions.</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PastParticiple"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Participle"/> + </rdfs:subClassOf> + <rdfs:comment>This is a verb in past participle.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/system.owl#UnitOfAnnotation"> + <rdfs:comment>A UnitOfAnnotation is a structural entity that can be annotated, e.g., a word, token, constituent, or another types of markable. +Word classes, etc., are then modelled as indirect children of UnitOfAnnotation. The division between Features and classes of UnitsOfAnnotation follows conventional standards. + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/system.owl#LinguisticAnnotation"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Unique"> + <rdfs:comment> + Unique approximates the linguistic concept "Particle". + It covers categories with unique or very small membership, + such as negative particle, which are `unassigned' to any of the standard part-of-speech categories. + (http://www.ilc.cnr.it/EAGLES96/annotate/node16.html#mp 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Pronoun"> + <rdfs:comment>This is a class, we inserted to structure the tagset.</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Pronoun"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#WHPrepositionalPhrase"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn-syntax.owl#Phrase"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#WHPrepositionalPhrase"/> + <rdfs:comment>WHPP|Wh-prepositional phrase. Prepositional phrase containing a wh-determiner, as in by whatever +means necessary. +(Santorini 1991) + +WHPP — Wh-prepositional Phrase. Prepositional phrase containing a wh-noun phrase (such as of which or by whose authority) that either introduces a PP gap or is contained by a WHNP. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#NumberFeature"> + <rdfs:comment> + Grammatical category for the variation in form of nouns, pronouns, and any words agreeing + with them, depending on how many persons or things are referred to. + (www.wordreference.com/English/definition.asp?en=number 12; http://www.isocat.org/datcat/DC-1298) + + A grammatical number is a morphological category characterized by the expression of quantity + through inflection or agreement. (http://en.wikipedia.org/wiki/Grammatical_number 17.11.06)</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#ParentheticalNode"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SyntaxTag"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ParentheticalPunctuation"/> + </rdfs:subClassOf> + <rdfs:comment>Parenthetical elements are dominated by a node labeled PRN. Punctuation marks that set off a parenthetical (i.e., commas, dashes, parentheses (-LRB- and -RRB-)) are contained within the PRN node. Use of PRN is determined ultimately by individual annotator intuition, though the presence of dashes or parentheses strongly suggests a parenthetical. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#LinguisticConcept"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AbsoluteTense"> + <rdfs:label>absolute tense</rdfs:label> + <rdfs:comment> + Absolute tense refers to a time in relation to the moment of utterance. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#absoluteTense with + reference to http://www.sil.org/linguistics/glossaryoflinguisticterms/whatisabsolutetense.htm") + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#TenseFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#BePresentTense"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment>These are verbforms in present tense. This class includes 3rd person singular or other than 3rd person singular verbforms.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Verb"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:comment> + A verb is a part of speech that usually denotes action ("bring", "read"), + occurrence ("decompose", "glitter"), or a state of being ("exist", "stand"). + Depending on the language, a verb may vary in form according to many factors, + possibly including its tense, aspect, mood and voice. It may also agree with + the person, gender, and/or number of some of its arguments (subject, object, etc.). + (http://en.wikipedia.org/wiki/Verb 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SubordinateClause"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#SubordinateClause"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn-syntax.owl#Clause"/> + <rdfs:comment>SBAR|Clause introduced by a (possibly empty) subordinating conjunction. +(Santorini 1991) + +SBAR is used for relative clauses and subordinate clauses, including indirect questions. ... +SBAR — Clause introduced by a (possibly empty) subordinating conjunction. + +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#AdjectivePhrase"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn-syntax.owl#Phrase"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#AdjectivePhrase"/> + <rdfs:comment>ADJP|Adjective phrase. Phrasal category headed by an adjective (including comparative and +superlative adjectives). Example: outrageously expensive. +(Santorini 1991) + +ADJP — Adjective Phrase. Phrasal category headed by an adjective (including comparative and superlative adjectives). Example: outrageously expensive. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ExistentialParticle"> + <rdfs:comment>English existential there is specified as a subtype of pronoun in MTE v4, i.e., Pronoun/Type="ex-there" (http://purl.org/olia/mte/multext-east.owl#ExistentialThere)</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Particle"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Phrase"> + <rdfs:comment> + Phrase is the class of syntactic constructions that consist of one or more + syntactic words, but lack the subject-predicate organization of a clause. + Phrases get their grammatical characteristics according to what word occupies + the head position; thus, all phrases have heads [Crystal 1980, 232-233; Pei + and Gaynor 1954, 169; Pike and Pike 1982, 453]. + (http://purl.org/linguistics/gold/Phrase) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Constituent"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounPhrase"> + <rdfs:comment> + At phrase level, the noun phrase is probably the least problematic of the categories to be dealt + with. In general, a noun phrase will a have noun or a pronoun as its head, and included within + the noun phrase are the determinative elements, any premodification, and any postmodification. + The examples below, 14 to 1... [truncated message content] |
From: <lor...@us...> - 2011-11-01 13:26:21
|
Revision: 3346 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3346&view=rev Author: lorenz_b Date: 2011-11-01 13:26:11 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Started new method to build the queries weighted by similarity and prominence. Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java Added Paths: ----------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/Allocation.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/WeightedQuery.java Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-10-31 22:11:38 UTC (rev 3345) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-11-01 13:26:11 UTC (rev 3346) @@ -26,6 +26,7 @@ import org.dllearner.algorithm.tbsl.search.SolrQueryResultSet; import org.dllearner.algorithm.tbsl.search.SolrSearch; import org.dllearner.algorithm.tbsl.search.ThresholdSlidingSolrSearch; +import org.dllearner.algorithm.tbsl.sparql.Allocation; import org.dllearner.algorithm.tbsl.sparql.Query; import org.dllearner.algorithm.tbsl.sparql.RatedQuery; import org.dllearner.algorithm.tbsl.sparql.SPARQL_Prefix; @@ -33,8 +34,10 @@ import org.dllearner.algorithm.tbsl.sparql.Slot; import org.dllearner.algorithm.tbsl.sparql.SlotType; import org.dllearner.algorithm.tbsl.sparql.Template; +import org.dllearner.algorithm.tbsl.sparql.WeightedQuery; import org.dllearner.algorithm.tbsl.templator.Templator; import org.dllearner.algorithm.tbsl.util.Prefixes; +import org.dllearner.algorithm.tbsl.util.Similarity; import org.dllearner.algorithm.tbsl.util.SolrQueryResultStringSimilarityComparator; import org.dllearner.algorithm.tbsl.util.StringSimilarityComparator; import org.dllearner.core.ComponentInitException; @@ -238,10 +241,17 @@ logger.info(t); } - //generate SPARQL query candidates, but select only a fixed number per template - template2Queries = getSPARQLQueryCandidates(templates, ranking); - sparqlQueryCandidates = getNBestQueryCandidatesForTemplates(template2Queries); +// //generate SPARQL query candidates, but select only a fixed number per template +// template2Queries = getSPARQLQueryCandidates(templates, ranking); +// sparqlQueryCandidates = getNBestQueryCandidatesForTemplates(template2Queries); + //get the weighted query candidates + Set<WeightedQuery> weightedQueries = getWeightedSPARQLQueries(templates); + sparqlQueryCandidates = new ArrayList<Query>(); + for(WeightedQuery wQ : weightedQueries){ + sparqlQueryCandidates.add(wQ.getQuery()); + } + //test candidates if(useRemoteEndpointValidation){ //on remote endpoint validateAgainstRemoteEndpoint(sparqlQueryCandidates); @@ -328,6 +338,122 @@ } } + private Set<WeightedQuery> getWeightedSPARQLQueries(Set<Template> templates){ + double alpha = 0.7; + double beta = 1 - alpha; + Map<Slot, Set<Allocation>> slot2Allocations = new HashMap<Slot, Set<Allocation>>(); + + Set<WeightedQuery> allQueries = new TreeSet<WeightedQuery>(); + + Set<Allocation> allAllocations; + for(Template t : templates){ + allAllocations = new HashSet<Allocation>(); + for(Slot slot : t.getSlots()){ + Set<Allocation> allocations = computeAllocation(slot); + allAllocations.addAll(allocations); + slot2Allocations.put(slot, allocations); + } + + int min = Integer.MAX_VALUE; + int max = Integer.MIN_VALUE; + for(Allocation a : allAllocations){ + if(a.getInDegree() < min){ + min = a.getInDegree(); + } + if(a.getInDegree() > max){ + max = a.getInDegree(); + } + } + for(Allocation a : allAllocations){ + double prominence = a.getInDegree()/(max-min); + a.setProminence(prominence); + + double score = alpha * a.getSimilarity() + beta * a.getProminence(); + a.setScore(score); + + } +// System.out.println(allAllocations); + + Set<WeightedQuery> queries = new HashSet<WeightedQuery>(); + Query cleanQuery = t.getQuery(); + queries.add(new WeightedQuery(cleanQuery)); + + Set<WeightedQuery> tmp = new HashSet<WeightedQuery>(); + for(Slot slot : t.getSlots()){ + for(Allocation a : slot2Allocations.get(slot)){ + for(WeightedQuery query : queries){ + if(slot.getSlotType() == SlotType.SYMPROPERTY){ + Query reversedQuery = new Query(query.getQuery()); + reversedQuery.getTriplesWithVar(slot.getAnchor()).iterator().next().reverse(); + reversedQuery.replaceVarWithURI(slot.getAnchor(), a.getUri()); + WeightedQuery w = new WeightedQuery(reversedQuery); + double newScore = query.getScore() + a.getScore(); + w.setScore(newScore); + tmp.add(w); + } + Query q = new Query(query.getQuery()); + q.replaceVarWithURI(slot.getAnchor(), a.getUri()); + WeightedQuery w = new WeightedQuery(q); + double newScore = query.getScore() + a.getScore(); + w.setScore(newScore); + tmp.add(w); + } + } + queries.clear(); + queries.addAll(tmp); + tmp.clear(); + } + for(WeightedQuery q : queries){ + q.setScore(q.getScore()/t.getSlots().size()); + } + allQueries.addAll(queries); + } + return allQueries; + } + + private Set<Allocation> computeAllocation(Slot slot){ + Set<Allocation> allocations = new HashSet<Allocation>(); + + SolrSearch index = getIndexBySlotType(slot); + + SolrQueryResultSet rs; + for(String word : slot.getWords()){ + rs = index.getResourcesWithScores(word, 10); + + for(SolrQueryResultItem item : rs.getItems()){ + int prominence = getProminenceValue(item.getUri(), slot.getSlotType()); + double similarity = Similarity.getSimilarity(word, item.getLabel()); + allocations.add(new Allocation(item.getUri(), prominence, similarity)); + } + + } + + return allocations; + } + + private int getProminenceValue(String uri, SlotType type){ + int cnt = 1; + String query = null; + if(type == SlotType.CLASS){ + query = "SELECT COUNT(?s) WHERE {?s a <%s>}"; + } else if(type == SlotType.PROPERTY || type == SlotType.SYMPROPERTY){ + query = "SELECT COUNT(*) WHERE {?s <%s> ?o}"; + } else if(type == SlotType.RESOURCE || type == SlotType.UNSPEC){ + query = "SELECT COUNT(*) WHERE {?s ?p <%s>}"; + } + query = String.format(query, uri); + + ResultSet rs = SparqlQuery.convertJSONtoResultSet(cache.executeSelectQuery(endpoint, query)); + QuerySolution qs; + String projectionVar; + while(rs.hasNext()){ + qs = rs.next(); + projectionVar = qs.varNames().next(); + cnt = qs.get(projectionVar).asLiteral().getInt(); + } + return cnt; + } + private Map<Template, Collection<? extends Query>> getSPARQLQueryCandidates(Set<Template> templates){ logger.info("Generating candidate SPARQL queries..."); mon.start(); @@ -483,11 +609,10 @@ return template2Queries; } - private Set<String> getCandidateURIs(Slot slot){ + private SolrQueryResultSet getCandidateURIs(Slot slot, int limit){ logger.info("Generating candidate URIs for " + slot.getWords() + "..."); mon.start(); SolrSearch index = null; - Set<String> uris = new HashSet<String>(); if(slot.getSlotType() == SlotType.CLASS){ index = class_index; } else if(slot.getSlotType() == SlotType.PROPERTY){ @@ -495,14 +620,13 @@ } else if(slot.getSlotType() == SlotType.RESOURCE){ index = resource_index; } + SolrQueryResultSet rs = new SolrQueryResultSet(); for(String word : slot.getWords()){ - uris.addAll(index.getResources("label:" + word)); - + rs.add(index.getResourcesWithScores(word, limit)); } mon.stop(); logger.info("Done in " + mon.getLastValue() + "ms."); - logger.info("Candidate URIs: " + uris); - return uris; + return rs; } private List<String> getCandidateURIsSortedBySimilarity(Slot slot){ @@ -641,7 +765,7 @@ index = resource_index; sorted = true; } - SolrQueryResultSet resultSet = null; + SolrQueryResultSet resultSet = new SolrQueryResultSet(); for(String word : slot.getWords()){ resultSet.add(index.getResourcesWithScores("label:" + word, sorted)); } @@ -777,6 +901,8 @@ return resources; } + + /** * @param args @@ -789,7 +915,7 @@ // Logger.getLogger(DefaultHttpParams.class).setLevel(Level.OFF); // Logger.getLogger(HttpClient.class).setLevel(Level.OFF); // Logger.getLogger(HttpMethodBase.class).setLevel(Level.OFF); - String question = "Who developed the video game World of Warcraft?"; + String question = "Give me all films produced by Hal Roach?"; // String question = "Give me all books written by authors influenced by Ernest Hemingway."; SPARQLTemplateBasedLearner learner = new SPARQLTemplateBasedLearner(); Added: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/Allocation.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/Allocation.java (rev 0) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/Allocation.java 2011-11-01 13:26:11 UTC (rev 3346) @@ -0,0 +1,57 @@ +package org.dllearner.algorithm.tbsl.sparql; + + +public class Allocation { + + private String uri; + private int inDegree; + + private double similarity; + private double prominence; + + private double score; + + public Allocation(String uri, int inDegree, double similarity) { + this.uri = uri; + this.inDegree = inDegree; + this.similarity = similarity; + } + + public String getUri() { + return uri; + } + + public int getInDegree() { + return inDegree; + } + + public double getSimilarity() { + return similarity; + } + + public double getProminence() { + return prominence; + } + + public void setProminence(double prominence) { + this.prominence = prominence; + } + + public double getScore() { + return score; + } + + public void setScore(double score) { + this.score = score; + } + + @Override + public String toString() { + return uri + "(similarity: " + similarity + "; prominence: " + inDegree + ")"; + } + + + + + +} Property changes on: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/Allocation.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/WeightedQuery.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/WeightedQuery.java (rev 0) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/WeightedQuery.java 2011-11-01 13:26:11 UTC (rev 3346) @@ -0,0 +1,46 @@ +package org.dllearner.algorithm.tbsl.sparql; + +public class WeightedQuery implements Comparable<WeightedQuery>{ + + private double score; + private Query query; + + public WeightedQuery(Query query, double score) { + super(); + this.score = score; + this.query = query; + } + + public WeightedQuery(Query query) { + this(query, 0); + } + + public double getScore() { + return score; + } + + public void setScore(double score) { + this.score = score; + } + + public Query getQuery() { + return query; + } + + @Override + public int compareTo(WeightedQuery o) { + if(o.getScore() < this.score){ + return -1; + } else if(o.getScore() > this.score){ + return 1; + } else return query.toString().compareTo(o.getQuery().toString()); + } + + @Override + public String toString() { + return query.toString() + "\n(Score: " + score + ")"; + } + + + +} Property changes on: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/WeightedQuery.java ___________________________________________________________________ Added: svn:mime-type + text/plain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-10-31 22:11:44
|
Revision: 3345 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3345&view=rev Author: lorenz_b Date: 2011-10-31 22:11:38 +0000 (Mon, 31 Oct 2011) Log Message: ----------- Fixed small bug. Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/search/SolrQueryResultItem.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/util/SolrQueryResultStringSimilarityComparator.java Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-10-31 14:14:31 UTC (rev 3344) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-10-31 22:11:38 UTC (rev 3345) @@ -150,7 +150,7 @@ String propertiesIndexUrl = options.fetch("solr.properties.url"); String propertiesIndexSearchField = options.fetch("solr.properties.searchfield"); - SolrSearch labelBasedPropertyIndex = new SolrSearch(propertiesIndexUrl, propertiesIndexSearchField, "label"); + SolrSearch labelBasedPropertyIndex = new ThresholdSlidingSolrSearch(propertiesIndexUrl, propertiesIndexSearchField, "label", 1.0, 0.1); String boaPatternIndexUrl = options.fetch("solr.boa.properties.url"); String boaPatternIndexSearchField = options.fetch("solr.boa.properties.searchfield"); @@ -536,13 +536,15 @@ } tmp.addAll(rs.getItems()); - int i = 0; + for(SolrQueryResultItem item : tmp){ - sortedURIs.add(item.getUri()); - if(i == MAX_URIS_PER_SLOT){ + if(!sortedURIs.contains(item.getUri())){ + sortedURIs.add(item.getUri()); + } + if(sortedURIs.size() == MAX_URIS_PER_SLOT){ break; } - i++; + } tmp.clear(); @@ -787,7 +789,7 @@ // Logger.getLogger(DefaultHttpParams.class).setLevel(Level.OFF); // Logger.getLogger(HttpClient.class).setLevel(Level.OFF); // Logger.getLogger(HttpMethodBase.class).setLevel(Level.OFF); - String question = "Is Natalie Portman an actress?"; + String question = "Who developed the video game World of Warcraft?"; // String question = "Give me all books written by authors influenced by Ernest Hemingway."; SPARQLTemplateBasedLearner learner = new SPARQLTemplateBasedLearner(); Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/search/SolrQueryResultItem.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/search/SolrQueryResultItem.java 2011-10-31 14:14:31 UTC (rev 3344) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/search/SolrQueryResultItem.java 2011-10-31 22:11:38 UTC (rev 3345) @@ -62,6 +62,11 @@ return false; return true; } + + @Override + public String toString() { + return uri + "(label: " + label + ", score: " + score + ")"; + } } Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/util/SolrQueryResultStringSimilarityComparator.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/util/SolrQueryResultStringSimilarityComparator.java 2011-10-31 14:14:31 UTC (rev 3344) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/util/SolrQueryResultStringSimilarityComparator.java 2011-10-31 22:11:38 UTC (rev 3345) @@ -1,28 +1,48 @@ package org.dllearner.algorithm.tbsl.util; import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; import org.dllearner.algorithm.tbsl.search.SolrQueryResultItem; public class SolrQueryResultStringSimilarityComparator implements Comparator<SolrQueryResultItem>{ private String s; + private Map<String, Double> cache; public SolrQueryResultStringSimilarityComparator(String s) { this.s = s; + cache = new HashMap<String, Double>(); } @Override public int compare(SolrQueryResultItem item1, SolrQueryResultItem item2) { - double sim1 = Similarity.getSimilarity(s, item1.getLabel()); - double sim2 = Similarity.getSimilarity(s, item2.getLabel()); - + double sim1 = 0; + if(cache.containsKey(item1.getLabel())){ + sim1 = cache.get(item1.getLabel()); + } else { + sim1 = Similarity.getSimilarity(s, item1.getLabel()); + cache.put(item1.getLabel(), sim1); + } + double sim2 = 0; + if(cache.containsKey(item2.getLabel())){ + sim2 = cache.get(item2.getLabel()); + } else { + sim2 = Similarity.getSimilarity(s, item2.getLabel()); + cache.put(item2.getLabel(), sim2); + } + if(sim1 < sim2){ return 1; } else if(sim1 > sim2){ return -1; } else { - return item1.getLabel().compareTo(item2.getLabel()); + int val = item1.getLabel().compareTo(item2.getLabel()); + if(val == 0){ + return item1.getUri().compareTo(item2.getUri()); + } + return val; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2011-10-31 14:14:41
|
Revision: 3344 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3344&view=rev Author: christinaunger Date: 2011-10-31 14:14:31 +0000 (Mon, 31 Oct 2011) Log Message: ----------- [tbsl] fixes for dbpedia:train Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-train-tagged(ideal).xml trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java 2011-10-31 09:33:13 UTC (rev 3343) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java 2011-10-31 14:14:31 UTC (rev 3344) @@ -299,8 +299,11 @@ semName = semName.substring(1); out.add(new Pair<String,String>("(NP NP* ADJ:'"+ w +"' " + rawNames + ")", "<x,l1,<e,t>,[ l1:[ y | SLOT_title(x,y), regex(y,'" + semName + "') ] ], [],[],[ SLOT_title/PROPERTY/title^name ]>")); + out.add(new Pair<String,String>("(NP NP* ADJ:'"+ w +"' " + rawNames + ")", "<x,l1,<e,t>,[ l1:[|] ],[],[],[ x/RESOURCE/"+semName+"]>")); out.add(new Pair<String,String>("(DP DP* ADJ:'"+ w +"' " + rawNames + ")", "<x,l1,<<e,t>,t>,[ l1:[ y | SLOT_title(x,y), regex(y,'" + semName + "') ] ], [],[],[ SLOT_title/PROPERTY/title^name ]>")); + out.add(new Pair<String,String>("(DP DP* ADJ:'"+ w +"' " + rawNames + ")", "<x,l1,<<e,t>,t>,[ l1:[|] ],[],[],[ x/RESOURCE/"+semName+"]>")); out.add(new Pair<String,String>("(ADJ ADJ:'"+ w +"' " + rawNames + ")", "<x,l1,<e,t>,[ l1:[ y | SLOT_title(x,y), regex(y,'" + semName + "') ] ], [],[],[ SLOT_title/PROPERTY/title^name ]>")); + out.add(new Pair<String,String>("(ADJ ADJ:'"+ w +"' " + rawNames + ")", "<x,l1,<e,t>,[ l1:[|] ],[],[],[ x/RESOURCE/"+semName+"]>")); return out; Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java 2011-10-31 09:33:13 UTC (rev 3343) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java 2011-10-31 14:14:31 UTC (rev 3344) @@ -227,18 +227,22 @@ m = nnpPattern.matcher(flat); while (m.find()) { flat = flat.replaceFirst(m.group(1),m.group(2) + "_" + m.group(3)); + m = nnpPattern.matcher(flat); } m = nnpPattern.matcher(flat); while (m.find()) { flat = flat.replaceFirst(m.group(1),m.group(2) + "_" + m.group(3)); + m = nnpPattern.matcher(flat); } m = nnPattern.matcher(flat); while (m.find()) { flat = flat.replaceFirst(m.group(1),m.group(2) + "_" + m.group(3)); + m = nnPattern.matcher(flat); } m = nnnnpPattern.matcher(flat); while (m.find()) { flat = flat.replaceFirst(m.group(1),m.group(2) + "/JJ"); + m = nnnnpPattern.matcher(flat); } return flat; Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java 2011-10-31 09:33:13 UTC (rev 3343) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java 2011-10-31 14:14:31 UTC (rev 3344) @@ -246,11 +246,15 @@ "(S DP[subj] (VP V:'" + token + "' DP[obj]))", "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>" + " ;; <x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; + String[] passEntry2 = {token, + "(S DP[subj] (VP V:'" + token + "' NUM[num]))", + "<x,l1,t,[ l1:[|], l4:[ y | SLOT_" + token + "(x,y), DATE(y,z) ] ],[(l2,x,subj,<<e,t>,t>),(l3,z,num,e)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; String[] whEntry = {token, "(S DP[obj] (VP DP[subj] V:'" + token + "'))", "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>" + " ;; <x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(passEntry); + result.add(passEntry2); result.add(whEntry); } else if (pos.equals("VBD") || pos.equals("VBZ") || pos.equals("VBP")) { @@ -279,7 +283,7 @@ result.add(wasGerEntry); } else if (pos.equals("WHEN")) { - String dateSlot = "SLOT_" + token + "/PROPERTY/" + token + "Date"; + String dateSlot = "SLOT_" + token + "/PROPERTY/" + token +"^" + token + "_date"; String tokenSlot = "SLOT_" + token + "/PROPERTY/" + token; String[] whenEntry1 = {token, "(S DP[subj] (VP V:'" + token + "'))", @@ -292,7 +296,7 @@ result.add(whenEntry2); } else if (pos.equals("WHERE")) { - String placeSlot = "SLOT_" + token + "/PROPERTY/" + token + "Place"; + String placeSlot = "SLOT_" + token + "/PROPERTY/" + token + "^" + token + "_place"; String tokenSlot = "SLOT_" + token + "/PROPERTY/" + token; String[] whereEntry1 = {token, "(S DP[subj] (VP V:'" + token + "'))", Modified: trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-train-tagged(ideal).xml =================================================================== --- trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-train-tagged(ideal).xml 2011-10-31 09:33:13 UTC (rev 3343) +++ trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-train-tagged(ideal).xml 2011-10-31 14:14:31 UTC (rev 3344) @@ -1958,7 +1958,7 @@ </answers> </question> <question id="10"> -<string>Who/WP was/VBD the/DT wife/NN of/IN President/NNP Lincoln/NNP</string> +<string>Who/WP was/VBD the/DT wife/NN of/IN president/NN Lincoln/NNP</string> <query> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> @@ -1985,7 +1985,7 @@ </answers> </question> <question id="9"> -<string>Who/WP developed/VBD the/DT video/NN game/NN World/NN of/IN Warcraft/NNP</string> +<string>Who/WP developed/VBD the/DT video/NN game/NN World/NNP of/NNP Warcraft/NNP</string> <query> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> @@ -25473,7 +25473,7 @@ </answers> </question> <question id="17"> -<string>In/IN which/WDT programming/NN language/NN is/VBZ GIMP/RB written/VBN</string> +<string>In/IN which/WDT programming/NN language/NN is/VBZ GIMP/NNP written/VBN</string> <query> PREFIX prop: <http://dbpedia.org/property/> PREFIX res: <http://dbpedia.org/resource/> Modified: trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex =================================================================== --- trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex 2011-10-31 09:33:13 UTC (rev 3343) +++ trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex 2011-10-31 14:14:31 UTC (rev 3344) @@ -86,7 +86,7 @@ the least || (DET DET:'the' DET:'least') || <y, l1, e, [ l1:[ | l2:[ y | ] THELEAST y l3:[|] ] ], [], [],[]> // CHEAT! - highest || (NP ADJ:'highest' NP*) || <x, l1, e, [ l1:[ | maximum(a,x,x) ] ], [], [],[]> ;; <x, l1, e, [ l1:[ | SLOT_high(x), maximum(a,x,x) ] ],[],[],[ SLOT_high/PROPERTY/height^elevation ]> + highest || (NP ADJ:'highest' NP*) || <x, l1, e, [ l1:[ | maximum(a,x,x) ] ], [], [],[]> ;; <x, l1, e, [ l1:[ j | SLOT_high(x,j), maximum(a,j,j) ] ],[],[],[ SLOT_high/PROPERTY/height^elevation ]> // COUNT more than || (DP DET:'more' DET:'than' NUM[num] NP[np]) || <y,l1,<<e,t>,t>,[ l1:[ y,c | count(y,c), greater(c,z) ] ],[(l2,y,np,<e,t>),(l3,z,num,e)],[l2=l1,l3=l1],[]> ;; <y,l1,<<e,t>,t>,[ l1:[ y | greater(y,z) ] ],[(l2,y,np,<e,t>),(l3,z,num,e)],[l2=l1,l3=l1],[]> @@ -158,7 +158,7 @@ there || (DP (NP EX:'there')) || <x,l1,<<e,t>,t>,[l1:[|]],[],[],[]> -// ORDINAL NUMBERS (1-10) +// NUMBERS (1-10) // --------------------- one || (NP NUM:'one' NP*) || <x,l1,<e,t>,[l1:[x|count(x,1)]],[],[],[]> @@ -181,4 +181,4 @@ seven || (NUM NUM:'seven') || <x,l1,e,[l1:[x|equal(x,7)]],[],[],[]> eight || (NUM NUM:'eight') || <x,l1,e,[l1:[x|equal(x,8)]],[],[],[]> nine || (NUM NUM:'nine') || <x,l1,e,[l1:[x|equal(x,9)]],[],[],[]> - ten || (NUM NUM:'ten') || <x,l1,e,[l1:[x|equal(x,10)]],[],[],[]> + ten || (NUM NUM:'ten') || <x,l1,e,[l1:[x|equal(x,10)]],[],[],[]> \ 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: <chr...@us...> - 2011-10-31 09:33:20
|
Revision: 3343 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3343&view=rev Author: christinaunger Date: 2011-10-31 09:33:13 +0000 (Mon, 31 Oct 2011) Log Message: ----------- [tbsl] fixed parse failures in dbpedia:test Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Scanner.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java 2011-10-31 09:29:27 UTC (rev 3342) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java 2011-10-31 09:33:13 UTC (rev 3343) @@ -63,7 +63,9 @@ Pattern compAdjPattern = Pattern.compile("(\\w+/RBR.(\\w+)/JJ)"); // Pattern superAdjPattern = Pattern.compile("(\\w+/RBS.(\\w+)/JJ)"); // TODO "(the most) official languages" vs "the (most official) languages" + Pattern howManyPattern = Pattern.compile("(how/WRB.many/JJ)"); Pattern howAdjPattern = Pattern.compile("(\\w+/WRB.(\\w+)(?<!many)/JJ)"); + Pattern thesameasPattern = Pattern.compile("(the/DT.same/JJ.(\\w+)/NN.as/IN)"); Pattern nprepPattern = Pattern.compile("\\s((\\w+)/NNS?.of/IN)"); Pattern didPattern = Pattern.compile("(?i)(\\s((did)|(do)|(does))/VB.?)\\s"); Pattern prepfrontPattern = Pattern.compile("(\\A\\w+/((TO)|(IN)).)\\w+/WDT"); // TODO (Nicht ganz sauber. Bei P-Stranding immer zwei Querys, hier nur eine.) @@ -95,11 +97,21 @@ // logger.trace("Replacing " + m.group(1) + " by " + m.group(2)+"/JJS"); // condensedstring = condensedstring.replaceFirst(m.group(1),m.group(2)+"/JJS"); // } + m = howManyPattern.matcher(condensedstring); + while (m.find()) { + logger.trace("Replacing " + m.group(1) + " by how/WLEX many/WLEX"); + condensedstring = condensedstring.replaceFirst(m.group(1),"how/WLEX many/WLEX"); + } m = howAdjPattern.matcher(condensedstring); while (m.find()) { logger.trace("Replacing " + m.group(1) + " by " + m.group(2)+"/JJH"); condensedstring = condensedstring.replaceFirst(m.group(1),m.group(2)+"/JJH"); } + m = thesameasPattern.matcher(condensedstring); + while (m.find()) { + logger.trace("Replacing " + m.group(1) + " by " + m.group(2)+"/NNSAME"); + condensedstring = condensedstring.replaceFirst(m.group(1),m.group(2)+"/NNSAME"); + } m = nprepPattern.matcher(condensedstring); while (m.find()) { logger.trace("Replacing " + m.group(1) + " by " + m.group(2)+"/NPREP"); Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Scanner.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Scanner.java 2011-10-31 09:29:27 UTC (rev 3342) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Scanner.java 2011-10-31 09:33:13 UTC (rev 3343) @@ -29,7 +29,7 @@ word_i = ""; } - if (t.getTerminal().equalsIgnoreCase(word_i)) { + if (t.getTerminal().equalsIgnoreCase(word_i) || t.getTerminal().matches(word_i + "\\d")) { // second disjunct: DISAM case state.side = 'r'; state.pos = 'a'; Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java 2011-10-31 09:29:27 UTC (rev 3342) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java 2011-10-31 09:33:13 UTC (rev 3343) @@ -10,7 +10,7 @@ public class SlotBuilder { - private String[] noun = {"NN","NNS","NNP","NNPS","NPREP","JJNN","JJNPREP"}; + private String[] noun = {"NN","NNS","NNP","NNPS","NPREP","JJNN","JJNPREP","NNSAME"}; private String[] adjective = {"JJ","JJR","JJS","JJH"}; private String[] verb = {"VB","VBD","VBG","VBN","VBP","VBZ","PASSIVE","PASSPART","VPASS","VPASSIN","GERUNDIN","VPREP","WHEN","WHERE"}; private String[] preps = {"IN","TO"}; @@ -43,7 +43,7 @@ else if (pos.equals("NNP") || pos.equals("NNPS")) { type = "RESOURCE"; } - else if (pos.equals("NPREP")) { + else if (pos.equals("NPREP") || pos.equals("NNSAME")) { type = "PROPERTY"; } @@ -168,6 +168,13 @@ // "<x,l1,<e,t>,[ l1:[ | SLOT_" + nntoken + "(x), SLOT_" + jjtoken + "(x) ] ],[],[],[" + slotnn + "," + slotjj + "]>"}; result.add(npEntry); } + else if (pos.equals("NNSAME")) { + String slot = "SLOT_" + token + "/" + type + "/" + token; + String[] nnentry = {token, + "(DP N:'" + token.toLowerCase() + "' DP[dp])", + "<x,l1,<<e,t>,t>, [ l1:[ z | SLOT_"+token+"(x,z), SLOT_"+token+"(y,z) ] ], [ (l2,y,dp,<<e,t>,t>) ], [ l2=l1 ],["+slot+"]>" }; + result.add(nnentry); + } } /* VERBS */ @@ -189,40 +196,28 @@ if (pos.equals("PASSIVE")) { String[] passEntry1 = {token, "(S DP[subj] (VP V:'" + token + "' DP[obj]))", - "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; + "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>" + + " ;; <x,l1,t,[ l1:[|], l4:[ | empty(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; String[] passEntry2 = {token, "(S DP[wh] (VP DP[dp] V:'" + token + "'))", - "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,wh,<<e,t>,t>),(l3,y,dp,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; - String[] passEntry1empty = {token, - "(S DP[subj] (VP V:'" + token + "' DP[obj]))", - "<x,l1,t,[ l1:[|], l4:[ | empty(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; - String[] passEntry2empty = {token, - "(S DP[wh] (VP DP[dp] V:'" + token + "'))", - "<x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,wh,<<e,t>,t>),(l3,y,dp,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; + "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,wh,<<e,t>,t>),(l3,y,dp,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>" + + " ;; <x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,wh,<<e,t>,t>),(l3,y,dp,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(passEntry1); result.add(passEntry2); - result.add(passEntry1empty); - result.add(passEntry2empty); } else if (pos.equals("PASSPART")) { String[] passpartEntry = {token, "(NP NP* (VP V:'" + token + "' DP[dp]))", - "<x,l1,t,[ l1:[ | SLOT_" + token + "(y,x) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[]>"}; - String[] passpartEntryEmpty = {token, - "(NP NP* (VP V:'" + token + "' DP[dp]))", - "<x,l1,t,[ l1:[ | empty(y,x) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[]>"}; + "<x,l1,t,[ l1:[ | SLOT_" + token + "(y,x) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[" + symslot + "]>" + + " ;; <x,l1,t,[ l1:[ | empty(y,x) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[]>"}; result.add(passpartEntry); - result.add(passpartEntryEmpty); } else if (pos.equals("VPASS")) { String[] passEntry = {token, "(S DP[subj] (VP V:'" + token + "'))", - "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; - String[] passEntryEmpty = {token, - "(S DP[subj] (VP V:'" + token + "'))", - "<x,l1,t,[ l1:[|], l4:[ | empty(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; + "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>" + + " ;; <x,l1,t,[ l1:[|], l4:[ | empty(y,x) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(passEntry); - result.add(passEntryEmpty); } else if (pos.equals("VPASSIN")) { String[] passEntry1 = {token, @@ -237,68 +232,51 @@ else if (pos.equals("GERUNDIN")) { String[] gerundinEntry1 = {token, "(NP NP* V:'" + token + "' DP[obj]))", - "<x,l1,t,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[" + symslot + "]>"}; + "<x,l1,t,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[" + symslot + "]>" + + " ;; <x,l1,t,[ l1:[ | empty(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[]>"}; String[] gerundinEntry2 = {token, "(ADJ V:'" + token + "' DP[obj]))", - "<x,l1,<e,t>,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[" + symslot + "]>"}; - String[] gerundinEntry1Empty = {token, - "(NP NP* V:'" + token + "' DP[obj]))", - "<x,l1,t,[ l1:[ | empty(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[]>"}; - String[] gerundinEntry2Empty = {token, - "(ADJ V:'" + token + "' DP[obj]))", - "<x,l1,<e,t>,[ l1:[ | empty(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[]>"}; + "<x,l1,<e,t>,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[" + symslot + "]>" + + " ;; <x,l1,<e,t>,[ l1:[ | empty(x,y) ] ],[(l2,y,obj,<<e,t>,t>)],[ l2=l1 ],[]>"}; result.add(gerundinEntry1); result.add(gerundinEntry2); - result.add(gerundinEntry1Empty); - result.add(gerundinEntry2Empty); } else if (pos.equals("VPREP")) { String[] passEntry = {token, "(S DP[subj] (VP V:'" + token + "' DP[obj]))", - "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; + "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>" + + " ;; <x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; String[] whEntry = {token, "(S DP[obj] (VP DP[subj] V:'" + token + "'))", - "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; - String[] passEntryEmpty = {token, - "(S DP[subj] (VP V:'" + token + "' DP[obj]))", - "<x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; - String[] whEntryEmpty = {token, - "(S DP[obj] (VP DP[subj] V:'" + token + "'))", - "<x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; + "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>" + + " ;; <x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(passEntry); result.add(whEntry); - result.add(passEntryEmpty); - result.add(whEntryEmpty); } else if (pos.equals("VBD") || pos.equals("VBZ") || pos.equals("VBP")) { String[] vEntry = {token, "(S DP[subj] (VP V:'" + token + "' DP[obj]))", - "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; - String[] vEntryEmpty = {token, - "(S DP[subj] (VP V:'" + token + "' DP[obj]))", - "<x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; + "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>" + + " ;; <x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(vEntry); - result.add(vEntryEmpty); } else if (pos.equals("VB")) { String[] whEntry = {token, "(S DP[obj] (VP DP[subj] V:'" + token + "'))", - "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>"}; - String[] whEntryEmpty = {token, - "(S DP[obj] (VP DP[subj] V:'" + token + "'))", - "<x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; + "<x,l1,t,[ l1:[|], l4:[ | SLOT_" + token + "(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[" + symslot + "]>" + + " ;; <x,l1,t,[ l1:[|], l4:[ | empty(x,y) ] ],[(l2,x,subj,<<e,t>,t>),(l3,y,obj,<<e,t>,t>)],[ l2<l1,l3<l1,l4<scope(l2),l4<scope(l3) ],[]>"}; result.add(whEntry); - result.add(whEntryEmpty); } else if (pos.equals("VBG") || pos.equals("VBN")) { String[] gerEntry = {token, "(NP NP* (VP V:'" + token + "' DP[dp]))", - "<x,l1,t,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[" + symslot + "]>"}; - String[] gerEntryEmpty = {token, - "(NP NP* (VP V:'" + token + "' DP[dp]))", - "<x,l1,t,[ l1:[ | empty(x,y) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[]>"}; + "<x,l1,t,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[" + symslot + "]>" + + " ;; <x,l1,t,[ l1:[ | empty(x,y) ] ],[(l2,y,dp,<<e,t>,t>)],[ l2=l1 ],[]>"}; + String[] wasGerEntry = {token, + "(S DP[comp] (VP V:'was' DP[subject] V:'" + token + "'))", + "<y,l1,t,[ l1:[ | SLOT_" + token + "(y,z) ] ],[(l2,y,comp,<<e,t>,t>), (l3,z,subject,<<e,t>,t>) ],[ l2=l1, l3=l1 ],[" + symslot + "]>"}; result.add(gerEntry); - result.add(gerEntryEmpty); + result.add(wasGerEntry); } else if (pos.equals("WHEN")) { String dateSlot = "SLOT_" + token + "/PROPERTY/" + token + "Date"; @@ -347,8 +325,8 @@ result.add(adjEntry); } if (pos.equals("JJH")) { - String[] howEntry = {"how "+token, - "(DP WH:'how' ADJ:'" + token.toLowerCase() + "')", + String[] howEntry = {token, + "(DP WH:'" + token.toLowerCase() + "')", "<x,l1,<<e,t>,t>,[ l1:[ ?j,x | SLOT_" + token + "(x,j) ] ],[],[],["+slot+"]>"}; result.add(howEntry); } @@ -393,15 +371,17 @@ } /* PREPOSITIONS */ else if (equalsOneOf(pos,preps)) { - String slot = "SLOT_" + token + "/SYMPROPERTY/"; + String slot = "SLOT_" + token + "/SYMPROPERTY/" + token; String[] npAdjunct = {token, "(NP NP* (PP P:'" + token.toLowerCase() + "' DP[pobj]))", - "<x,l1,<e,t>,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,pobj,<<e,t>,t>)],[l2=l1],["+slot+"]>"}; - String[] npAdjunctEmpty = {token, - "(NP NP* (PP P:'" + token.toLowerCase() + "' DP[pobj]))", - "<x,l1,<e,t>,[ l1:[ | empty(x,y) ] ],[(l2,y,pobj,<<e,t>,t>)],[l2=l1],[]>"}; + "<x,l1,<e,t>,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,pobj,<<e,t>,t>)],[l2=l1],["+slot+"]>" + + " ;; <x,l1,<e,t>,[ l1:[ | empty(x,y) ] ],[(l2,y,pobj,<<e,t>,t>)],[l2=l1],[]>"}; + String[] vpAdjunct = {token, + "(VP VP* (PP P:'" + token.toLowerCase() + "' DP[pobj]))", + "<x,l1,t,[ l1:[ | SLOT_" + token + "(x,y) ] ],[(l2,y,pobj,<<e,t>,t>)],[l2=l1],["+slot+"]>" + + " ;; <x,l1,t,[ l1:[ | empty(x,y) ] ],[(l2,y,pobj,<<e,t>,t>)],[l2=l1],[]>"}; result.add(npAdjunct); - result.add(npAdjunctEmpty); + result.add(vpAdjunct); } } Modified: trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml =================================================================== --- trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml 2011-10-31 09:29:27 UTC (rev 3342) +++ trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml 2011-10-31 09:33:13 UTC (rev 3343) @@ -60,7 +60,7 @@ <string>What/WP is/VBZ the/DT revenue/NN of/IN IBM/NNP</string> </question> <question id="38"> -<string>Which/WDT states/VBZ border/VBZ Utah/NNP</string> +<string>Which/WDT states/NNS border/VBZ Utah/NNP</string> </question> <question id="13"> <string>In/IN which/WDT country/NN is/VBZ the/DT Limerick/NNP Lake/NNP</string> Modified: trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex =================================================================== --- trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex 2011-10-31 09:29:27 UTC (rev 3342) +++ trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex 2011-10-31 09:33:13 UTC (rev 3343) @@ -18,8 +18,8 @@ is there || (S V:'is' C:'there' DP[dp]) || <x, l1, t, [ l1:[ | ] ], [ (l2,x,dp,<<e,t>,t>) ], [ l2=l1 ],[]> are there || (S V:'are' C:'there' DP[dp]) || <x, l1, t, [ l1:[ | ] ], [ (l2,x,dp,<<e,t>,t>) ], [ l2=l1 ],[]> - is there || (S DP[dp] V:'is' C:'there') || <x, l1, t, [ l1:[ | ] ], [ (l2,x,dp,<<e,t>,t>) ], [ l2=l1 ],[]> - are there || (S DP[dp] V:'are' C:'there') || <x, l1, t, [ l1:[ | ] ], [ (l2,x,dp,<<e,t>,t>) ], [ l2=l1 ],[]> + is there || (S DP[dp] (VP V:'is' C:'there')) || <x, l1, t, [ l1:[ | ] ], [ (l2,x,dp,<<e,t>,t>) ], [ l2=l1 ],[]> + are there || (S DP[dp] (VP V:'are' C:'there')) || <x, l1, t, [ l1:[ | ] ], [ (l2,x,dp,<<e,t>,t>) ], [ l2=l1 ],[]> // TO BE: YES/NO QUESTIONS @@ -93,7 +93,7 @@ less than || (DP DET:'less' DET:'than' NUM[num] NP[np]) || <y,l1,<<e,t>,t>,[ l1:[ y,c | count(y,c), less(c,z) ] ],[(l2,y,np,<e,t>),(l3,z,num,e)],[l2=l1,l3=l1],[]> ;; <y,l1,<<e,t>,t>,[ l1:[ y | less(y,z) ] ],[(l2,y,np,<e,t>),(l3,z,num,e)],[l2=l1,l3=l1],[]> // HOW - how || (DP DET:'how' ADJ[adj]) || <x,l1,<<e,t>,t>,[ l1:[?x|] ],[ (x,l2,adj,<e,t>) ],[l2=l1],[]> + // how || (DP DET:'how' ADJ[adj]) || <x,l1,<<e,t>,t>,[ l1:[?x,|] ],[ (x,l2,adj,<e,t>) ],[l2=l1],[]> // EMPTY STUFF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-10-31 09:29:33
|
Revision: 3342 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3342&view=rev Author: lorenz_b Date: 2011-10-31 09:29:27 +0000 (Mon, 31 Oct 2011) Log Message: ----------- Changed eval pdf header. Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/util/LatexWriter.java trunk/components-ext/src/main/resources/tbsl/evaluation/praeambel.tex trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/Evaluation.java Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/util/LatexWriter.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/util/LatexWriter.java 2011-10-30 11:45:33 UTC (rev 3341) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/util/LatexWriter.java 2011-10-31 09:29:27 UTC (rev 3342) @@ -124,10 +124,12 @@ } - public void write(String file){ + public void write(String file, String time, int correctAnswers){ endSummaryTable(); StringBuilder latex = new StringBuilder(); latex.append(loadPraeambel()); + latex.append("\\subtitle{" + time + "}\n"); + latex.append("\\author{Correct answers:" + correctAnswers + "}\n"); latex.append("\\begin{document}"); latex.append("\\maketitle\n"); latex.append("\\newpage\n"); Modified: trunk/components-ext/src/main/resources/tbsl/evaluation/praeambel.tex =================================================================== --- trunk/components-ext/src/main/resources/tbsl/evaluation/praeambel.tex 2011-10-30 11:45:33 UTC (rev 3341) +++ trunk/components-ext/src/main/resources/tbsl/evaluation/praeambel.tex 2011-10-31 09:29:27 UTC (rev 3342) @@ -1,4 +1,4 @@ -\documentclass[a4paper,10pt]{article} +\documentclass[a4paper,10pt]{scrartcl} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} @@ -42,3 +42,4 @@ %opening \title{Evaluation} +\date{} \ No newline at end of file Modified: trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/Evaluation.java =================================================================== --- trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/Evaluation.java 2011-10-30 11:45:33 UTC (rev 3341) +++ trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/Evaluation.java 2011-10-31 09:29:27 UTC (rev 3342) @@ -56,6 +56,7 @@ import com.hp.hpl.jena.sparql.vocabulary.FOAF; import com.hp.hpl.jena.vocabulary.RDF; import com.hp.hpl.jena.vocabulary.RDFS; +import com.ibm.icu.util.Calendar; public class Evaluation{ @@ -300,8 +301,8 @@ public void run(){ int topN2Print = 10; + int correctAnswers = 0; - int questionId = -1; String question = ""; String targetQuery; @@ -311,7 +312,7 @@ String errorCode = ""; LatexWriter latex = new LatexWriter(); int i = 0; - for(Entry<Integer, String> entry : id2Question.entrySet()){if(entry.getKey()==50)continue; + for(Entry<Integer, String> entry : id2Question.entrySet()){//if(entry.getKey()==50)continue; if(testID != -1 && entry.getKey() != testID)continue; try { questionId = entry.getKey(); @@ -454,6 +455,9 @@ latex.addText(escapeAnswerString(learnedAnswer, targetAnswer)); precision = computePrecision(targetAnswer, learnedAnswer); recall = computeRecall(targetAnswer, learnedAnswer); + if(precision == 1 && recall == 1){ + correctAnswers++; + } } latex.addSummaryTableEntry(questionId, extractSentence(question), precision, recall, errorCode); @@ -468,7 +472,8 @@ latex.addSummaryTableEntry(questionId, extractSentence(question), precision, recall, errorCode); } } - latex.write("log/evaluation.tex"); + + latex.write("log/evaluation_" + System.currentTimeMillis()+ ".tex", Calendar.getInstance().getTime().toString(), correctAnswers); } public static List<String> extractEntities(String query){ @@ -667,7 +672,7 @@ } } latex.endDocument(); - latex.write("log/evaluation" + new Date().getHours() + "_" + new Date().getMinutes() + ".tex"); + latex.write("log/evaluation_" + System.nanoTime() + ".tex", Calendar.getInstance().getTime().toString(), 0); } private String escapeAnswerString(Object learnedAnswer, Object targetAnswer){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <seb...@us...> - 2011-10-30 11:45:40
|
Revision: 3341 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3341&view=rev Author: sebastianwtr Date: 2011-10-30 11:45:33 +0000 (Sun, 30 Oct 2011) Log Message: ----------- [tbsl] added a few getter and setter methods and start to implement the different iterations Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Sparql/SparqlObject.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/exploration_main.java Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Sparql/SparqlObject.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Sparql/SparqlObject.java 2011-10-29 20:29:02 UTC (rev 3340) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Sparql/SparqlObject.java 2011-10-30 11:45:33 UTC (rev 3341) @@ -1,8 +1,13 @@ package org.dllearner.algorithm.tbsl.exploration.Sparql; import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.OutputStreamWriter; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; @@ -15,6 +20,7 @@ import org.dllearner.algorithm.tbsl.nlp.WordNet; import org.dllearner.algorithm.tbsl.sparql.BasicQueryTemplate; import org.dllearner.algorithm.tbsl.sparql.Path; +import org.dllearner.algorithm.tbsl.sparql.SPARQL_Filter; import org.dllearner.algorithm.tbsl.sparql.SPARQL_Term; import org.dllearner.algorithm.tbsl.sparql.Slot; import org.dllearner.algorithm.tbsl.sparql.Template; @@ -27,18 +33,15 @@ //global Variable dict //start counting with 0 - static int iteration_deept=1; + static int explorationdepthwordnet=1; + static int iterationdepth =0; + static int numberofanswers=1; static WordNet wordnet; BasicTemplator btemplator; Templator templator; HashMap<String, String> hm; - /*Set<BasicQueryTemplate> querytemps = btemplator.buildBasicQueries(line); - for (BasicQueryTemplate temp : querytemps) { - System.out.println(temp.toString()); - } - - */ + //Konstruktor public SparqlObject(HashMap<String, String> hm_new) throws MalformedURLException{ wordnet = new WordNet(); @@ -47,9 +50,233 @@ btemplator = new BasicTemplator(); templator = new Templator(); System.out.println("Loading SPARQL Templator Done\n"); + setExplorationdepthwordnet(1); + setIterationdepth(0); + setNumberofanswers(1); } + + /* + * ##################################### + * Getter and Setter Methods + */ + + public int getExplorationdepthwordnet() { + return explorationdepthwordnet; + } + + public void setExplorationdepthwordnet(int explorationdepthwordnet) { + SparqlObject.explorationdepthwordnet = explorationdepthwordnet; + } + + + public int getIterationdepth() { + return iterationdepth; + } + + + public void setIterationdepth(int iterationdepth) { + SparqlObject.iterationdepth = iterationdepth; + } + + + public int getNumberofanswers() { + return numberofanswers; + } + + + public void setNumberofanswers(int numberofanswers) { + SparqlObject.numberofanswers = numberofanswers; + } + + /* + * ############################## + * + */ + /* + * "Main" Method of this Class. + * + */ + public void create_Sparql_query(String question) throws JWNLException, IOException{ + //create_Sparql_query_new(string); + + ArrayList<String> lstquery = new ArrayList<String>(); + lstquery=getQuery(question); + + //if(!lstquery.isEmpty()){ + //for each querry + for(String query : lstquery){ + + /* + * ################################################################################################# + */ + //only testfunction to save the generated queries in the tmp-folder + if(getIterationdepth()==-1){ + String tmp = new String(); + String s = null; + BufferedReader in = null; + + // Lies Textzeilen aus der Datei in einen Vector: + try { + in = new BufferedReader( + new InputStreamReader( + new FileInputStream( "/tmp/testresult.txt" ) ) ); + while( null != (s = in.readLine()) ) { + tmp=tmp+"\n"+s; + } + } catch( FileNotFoundException ex ) { + } catch( Exception ex ) { + System.out.println( ex ); + } finally { + if( in != null ) + try { + in.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + String out=null; + if (query=="" || query==" ") query="Could not parse"; + out=tmp + "\n" + question + ":\n"+query+"\n"; + + BufferedWriter outfile = new BufferedWriter( + new OutputStreamWriter( + new FileOutputStream( "/tmp/testresult.txt" ) ) ); + + outfile.write(out); + outfile.close(); + + } + + /* + * ################################################################################################# + */ + //Iteration 0 + if(getIterationdepth()==0){ + String tmp = new String(); + String s = null; + BufferedReader in = null; + + // Lies Textzeilen aus der Datei in einen Vector: + try { + in = new BufferedReader( + new InputStreamReader( + new FileInputStream( "/tmp/answer.txt" ) ) ); + while( null != (s = in.readLine()) ) { + tmp=tmp+"\n"+s; + } + } catch( FileNotFoundException ex ) { + } catch( Exception ex ) { + System.out.println( ex ); + } finally { + if( in != null ) + try { + in.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + String answer; + answer=sendServerQuestionRequest(query); + //System.out.println(query); + System.out.println("Antwort: " + answer); + String out=tmp + "\n" + question + ":\n"+answer+"\n"; + + BufferedWriter outfile = new BufferedWriter( + new OutputStreamWriter( + new FileOutputStream( "/tmp/answer.txt" ) ) ); + + outfile.write(out); + outfile.close(); + } + /* + * ################################################################################################# + */ + //Iterration 1 + if(getIterationdepth()==1){ + + } + /* + * ################################################################################################# + */ + //Iterration 2 + if(getIterationdepth()==2){ + + } + } + } + + // string=string.replaceAll("?", ""); + //create_Sparql_query_old(string); + + // } + + /** + * Method gets a String and takes the information from the templator to creat a Sparql query. + * @param question question in natural language + * @return ArrayList of Sparql queries. + */ + private ArrayList<String> getQuery(String question) { + ArrayList<String> lstquery = new ArrayList<String>(); + Set<BasicQueryTemplate> querytemps = btemplator.buildBasicQueries(question); + for (BasicQueryTemplate temp : querytemps) { + + /*System.out.println("temp.getQt();" + temp.getQt()); + System.out.println("temp.getSelTerms();" + temp.getSelTerms()); + System.out.println("temp.getVariablesAsStringList();" + temp.getVariablesAsStringList()); + System.out.println("temp.getConditions();" + temp.getConditions()); + System.out.println("temp.getSlots();" + temp.getSlots());*/ + + String query; + String selTerms =""; + for(SPARQL_Term terms :temp.getSelTerms()) selTerms=selTerms+(terms.toString())+" "; + + String conditions = ""; + for(Path condition: temp.getConditions()) conditions=conditions+(condition.toString())+"."; + + String filters=""; + for(SPARQL_Filter tmp : temp.getFilters()) filters=filters+tmp+" "; + //System.out.println("\n"); + System.out.println("\n"); + query="PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "+temp.getQt().toString()+" "+selTerms+" { "+ conditions.replace("--","") + "}"+filters; + + String[] slots= null; + for(Slot slot : temp.getSlots()){ + + //hier muss dann noch die abfrage aus der hm raus, also das direkt die uri eingebettet wird. + String tmp= slot.toString(); + tmp= tmp.replace("UNSPEC",""); + tmp= tmp.replace("RESOURCE",""); + tmp= tmp.replace("{",""); + tmp= tmp.replace("}",""); + tmp=tmp.replace(" ",""); + //System.out.println(tmp); + //damit auch wirklich nur ?y und nicht ?y0 ersetzt wird, einfach nach "?y " suchen. + String[] array = tmp.split(":"); + String replace; + if(array[0].length()<2)replace = "?"+array[0]+" "; + else replace="?"+array[0]; + //System.out.println("replace: " + replace); + //hier dann den hm wert von array[1] eintragen + query=query.replace(replace, "<"+hm.get(array[1].toLowerCase())+">"); + + } + //System.out.println("Query: "+query); + lstquery.add(query); + + } + + return lstquery; + } + + + + + private void doIteration(String string1, String string2) throws JWNLException{ long startTime = System.currentTimeMillis(); @@ -70,13 +297,13 @@ e.printStackTrace(); } - System.out.println("Start Iterating Wordnet with "+string1+" and deept of "+iteration_deept); + System.out.println("Start Iterating Wordnet with "+string1+" and deept of "+explorationdepthwordnet); ArrayList<String> semantics=new ArrayList<String>(); ArrayList<String> tmp_semantics=new ArrayList<String>(); ArrayList<String> result_SemanticsMatchProperties=new ArrayList<String>(); semantics.add(string1); tmp_semantics=semantics; - for(int i=0;i<=iteration_deept;i++){ + for(int i=0;i<=explorationdepthwordnet;i++){ try { tmp_semantics=getSemantics(tmp_semantics); @@ -119,142 +346,9 @@ System.out.println("Getting Properties, Semantics and Answer from server took "+(endTime2-startTime) +" ms"); } - - private void create_Sparql_query_new(String string) throws JWNLException{ - String[] array_new=new String[4]; - array_new=getyy0AndQuery(string); - if(!array_new[0].contains("error")){ - String result=null; - - //Version 1 - result=sendServerQuestionRequest(array_new[0]); - if(result!="noanswer"){ - // System.out.println("Version1"); - System.out.println(result); - } - else{ - doIteration(array_new[3],array_new[2]); - } - //Version2 - /* else{ - result=sendServerQuestionRequest(array_new[1]); - if(result!="noanswer"){ - System.out.println("Version2"); - System.out.println(result); - } - }*/ - } - - } - public void create_Sparql_query(String string) throws JWNLException{ - //create_Sparql_query_new(string); - - Set<BasicQueryTemplate> querytemps = btemplator.buildBasicQueries(string.toLowerCase()); - for (BasicQueryTemplate temp : querytemps) { - - System.out.println("temp.getQt();" + temp.getQt()); - System.out.println("temp.getSelTerms();" + temp.getSelTerms()); - System.out.println("temp.getVariablesAsStringList();" + temp.getVariablesAsStringList()); - System.out.println("temp.getConditions();" + temp.getConditions()); - System.out.println("temp.getSlots();" + temp.getSlots()); - - String query; - SPARQL_Term selTerms = null; - for(SPARQL_Term terms :temp.getSelTerms()) selTerms=terms; - - Path conditions = null; - for(Path condition: temp.getConditions()) conditions=condition; - - - - //System.out.println("\n"); - System.out.println("\n"); - query=temp.getQt().toString()+" "+selTerms.toString()+" { "+ conditions.toString().replace("--","") + "} "; - - String[] slots= null; - for(Slot slot : temp.getSlots()){ - - //hier muss dann noch die abfrage aus der hm raus, also das direkt die uri eingebettet wird. - String tmp= slot.toString(); - tmp= tmp.replace("UNSPEC",""); - tmp= tmp.replace("RESOURCE",""); - tmp= tmp.replace("{",""); - tmp= tmp.replace("}",""); - tmp=tmp.replace(" ",""); - //System.out.println(tmp); - //damit auch wirklich nur ?y und nicht ?y0 ersetzt wird, einfach nach "?y " suchen. - String[] array = tmp.split(":"); - String replace; - if(array[0].length()<2)replace = "?"+array[0]+" "; - else replace="?"+array[0]; - //System.out.println("replace: " + replace); - //hier dann den hm wert von array[1] eintragen - query=query.replace(replace, "<"+hm.get(array[1])+">"); - - } - System.out.println(query); - } - // string=string.replaceAll("?", ""); - //create_Sparql_query_old(string); - - } - - - - - private String[] getyy0AndQuery(String string) { - String teststring=""; - String[] return_array = new String[4]; - Set<BasicQueryTemplate> querytemps = btemplator.buildBasicQueries(string); - for (BasicQueryTemplate temp : querytemps) { - teststring=temp.toString(); - System.out.println(teststring); - } - teststring=teststring.replace("\n", ""); - String[] array_tmp=teststring.split("\\}"); - - //only for y and y0 - String sparqlquery=""; - String y=""; - String y0=""; - for(String i : array_tmp){ - i=i.replace(" ", ""); - String[] tmp=null; - if(i.contains("SELECT")) sparqlquery=i.concat("}"); - if(i.contains("y0")){ - y0=i; - tmp=y0.split("\\{"); - y0=tmp[1];} - if(i.contains("y")&& !i.contains("y0")){ - y=i; - tmp=y.split("\\{"); - y=tmp[1]; - } - } - String uri1=hm.get(y0); - String uri2=hm.get(y); - if(uri1!=null && uri2!=null){ - uri1=uri1.replace("Category:", ""); - uri1=uri1.replace("category:", ""); - uri2=uri2.replace("Category:", ""); - uri2=uri2.replace("category:", ""); - String anfrage1; - anfrage1="PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>select ?x where { <"+uri1+"> <"+uri2+"> ?x.}"; - String anfrage2; - anfrage2="PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>select ?x where { <"+uri2+"> <"+uri1+"> ?x.}"; - return_array[0]=anfrage1; - return_array[1]=anfrage2; - return_array[2]=y0; - return_array[3]=y; - } - else{ - return_array[0]="error"; - } - return return_array; - - } + private static ArrayList<String> getSemantics (ArrayList<String> semantics) throws IOException, JWNLException { ArrayList<String> result = new ArrayList<String>(); for(String id :semantics){ @@ -294,12 +388,11 @@ counter=counter+1;} } while (str != null); - if(result.isEmpty()) System.out.println("HALOSHSS"); - //TODO:if counter = 5 or less, there is an empty answer from the Server! Still to Verify! - if(counter<=5){ + //TODO:if counter = 5 or less, there is an empty answer from the Server! Still to Verify! + /* if(counter<=5){ System.out.println("Empty Answer from Server"); return "noanswer"; - } + }*/ } catch (MalformedURLException e) { System.out.println("Must enter a valid URL"); } catch (IOException e) { @@ -324,6 +417,7 @@ string=string.replace(" ",""); string=string.replace("</td>",""); string=string.replace("<td>",""); + string=string.replace("<th>callret-0</th>", ""); return string; } Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/exploration_main.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/exploration_main.java 2011-10-29 20:29:02 UTC (rev 3340) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/exploration_main.java 2011-10-30 11:45:33 UTC (rev 3341) @@ -69,18 +69,52 @@ System.out.println("Time for Initialising "+(stopInitTime-startInitTime)+" ms"); boolean schleife=true; + boolean doing = true; while(schleife==true){ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; + doing = true; try { System.out.println("\n\n"); System.out.println("Please enter a Question:"); line = in.readLine(); - if(line.contains("quit")){ + if(line.contains(":q")){ schleife=false; System.out.println("Bye!"); + System.exit(0); } - if(line.contains("text")&& schleife==true){ + if(line.contains(":setIterationdepth")){ + String[] tmp=line.split(" "); + int i_zahl = new Integer(tmp[1]).intValue(); + if(tmp.length>=2) sparql.setIterationdepth(i_zahl); + doing = false; + } + if(line.contains(":getIterationdepth")){ + System.out.println(sparql.getIterationdepth()); + doing = false; + } + if(line.contains(":setExplorationdepthwordnet")){ + String[] tmp=line.split(" "); + int i_zahl = new Integer(tmp[1]).intValue(); + if(tmp.length>=2) sparql.setExplorationdepthwordnet(i_zahl); + doing = false; + } + if(line.contains(":getExplorationdepthwordnet")){ + System.out.println(sparql.getExplorationdepthwordnet()); + doing = false; + } + if(line.contains(":setNumberofanswer")){ + String[] tmp=line.split(" "); + int i_zahl = new Integer(tmp[1]).intValue(); + if(tmp.length>=2) sparql.setNumberofanswers(i_zahl); + doing = false; + } + if(line.contains(":getNumberofanswer")){ + System.out.println(sparql.getNumberofanswers()); + doing = false; + } + + if(line.contains(":textfile")&& schleife==true){ TimeZone.setDefault(TimeZone.getTimeZone("GMT")); @@ -96,8 +130,7 @@ System.out.println(s); anzahl++; //get each line and send it to the parser - s=s.replace("?",""); - sparql.create_Sparql_query(s.toLowerCase()); + sparql.create_Sparql_query(s); } long timeNow = System.currentTimeMillis(); long diff = timeNow-startTime; @@ -105,14 +138,9 @@ System.out.println("Time for "+anzahl+" questions = "+diff+" ms."); } - else if(schleife==true){ + else if(schleife==true && doing ==true){ long startTime = System.currentTimeMillis(); - line=line.replace("?",""); - /* Set<BasicQueryTemplate> querytemps = btemplator.buildBasicQueries(line); - for (BasicQueryTemplate temp : querytemps) { - System.out.println(temp.toString()); - }*/ - sparql.create_Sparql_query(line.toLowerCase()); + sparql.create_Sparql_query(line); long endTime= System.currentTimeMillis(); System.out.println("\n The complete answering of the Question took "+(endTime-startTime)+" ms"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-10-29 20:29:08
|
Revision: 3340 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3340&view=rev Author: lorenz_b Date: 2011-10-29 20:29:02 +0000 (Sat, 29 Oct 2011) Log Message: ----------- Added String datatype. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java Modified: trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java 2011-10-28 14:01:16 UTC (rev 3339) +++ trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java 2011-10-29 20:29:02 UTC (rev 3340) @@ -339,8 +339,8 @@ return factory.getIntegerOWLDatatype(); else if(datatype.equals(OWL2Datatype.DOUBLE.getDatatype())) return factory.getDoubleOWLDatatype(); -// else if(datatype.equals(Datatype.STRING)) -// return factory.getOWLDataType(Datatype.STRING.getURI()); + else if(datatype.equals(OWL2Datatype.STRING.getDatatype())) + return factory.getOWLDatatype(IRI.create(OWL2Datatype.STRING.getURI())); throw new Error("OWLAPIDescriptionConverter: datatype "+datatype+" not implemented"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2011-10-28 14:01:27
|
Revision: 3339 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3339&view=rev Author: christinaunger Date: 2011-10-28 14:01:16 +0000 (Fri, 28 Oct 2011) Log Message: ----------- [tbsl] small bug fixes and changes Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/converter/DRS2SPARQL_Converter.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/SPARQL_Pair.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/Templator.java trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/converter/DRS2SPARQL_Converter.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/converter/DRS2SPARQL_Converter.java 2011-10-28 09:43:10 UTC (rev 3338) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/converter/DRS2SPARQL_Converter.java 2011-10-28 14:01:16 UTC (rev 3339) @@ -76,7 +76,7 @@ } template = new Template(new Query()); - slots = ls; + // slots = ls; Query q = convert(drs, new Query(), false); if (q == null) { @@ -102,7 +102,7 @@ } // System.out.println("--- DRS (after) : " + drs); // DEBUG - for (DiscourseReferent referent : drs.getDRs()) { + for (DiscourseReferent referent : drs.collectDRs()) { if (referent.isMarked()) { SPARQL_Term term = new SPARQL_Term(referent.toString().replace("?","")); term.setIsVariable(true); @@ -115,9 +115,13 @@ f.addNotBound(term); query.addFilter(f); } + +// System.out.println("--- referent: " + referent.toString()); // DEBUG for (Slot s : slots) { - if (s.getAnchor().equals(referent.toString())) { - template.addSlot(s); +// System.out.println("--- slot: " + s.toString()); // DEBUG + if (s.getAnchor().equals(referent.getValue()) || s.getAnchor().equals(referent.toString())) { +// System.out.println(" fits!"); // DEBUG + template.addSlot(s); break; } } Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java 2011-10-28 09:43:10 UTC (rev 3338) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/GrammarFilter.java 2011-10-28 14:01:16 UTC (rev 3339) @@ -254,7 +254,7 @@ try { for (String[] entry : entries) { String anchor = entry[0]; - String treestring = entry[1]; + String treestring = entry[1]; List<String> dudeStrings = new ArrayList<String>(); for (String s : entry[2].trim().split(";;")) { if (!s.equals("")) { Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java 2011-10-28 09:43:10 UTC (rev 3338) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/ltag/parser/Preprocessor.java 2011-10-28 14:01:16 UTC (rev 3339) @@ -70,8 +70,8 @@ Pattern passivePattern1a = Pattern.compile("(((has)|(have)|(had))/VB[A-Z]?.been/VBN.(\\w+)/VBN.by/IN)"); Pattern passivePattern1b = Pattern.compile("(\\s((has)|(have)|(had))/VB[A-Z]?(.+\\s)been/VBN\\s(\\w+)/VB(N|D))"); Pattern passivePattern2a = Pattern.compile("(((is)|(are)|(was)|(were))/VB[A-Z]?.(\\w+)/VBN.by/IN)"); - Pattern pseudopassPattern = Pattern.compile("(((is)|(are)|(was)|(were))/VB[A-Z]?.(\\w+)/VBN.\\w+/TO)"); - Pattern pseudopwhPattern = Pattern.compile("(((is)|(are)|(was)|(were))/VB[A-Z]?.(.+)\\s(\\w+)/VB(N|D).\\w+/TO)"); + Pattern pseudopassPattern = Pattern.compile("(((is)|(are)|(was)|(were))/VB[A-Z]?.(\\w+)/VBN.\\w+/((TO)|(IN)))"); + Pattern pseudopwhPattern = Pattern.compile("(((is)|(are)|(was)|(were))/VB[A-Z]?.(.+)\\s(\\w+)/VB(N|D).\\w+/((TO)|(IN)))"); Pattern saveIsThere = Pattern.compile("((is)|(are))/(VB[A-Z]?).there/(RB)"); Pattern passivePattern2b = Pattern.compile("(((is)|(are)|(was)|(were))/VB[A-Z]?.((.+)\\s\\w+)/VB(N|D))"); Pattern passpartPattern = Pattern.compile("\\s((\\w+)/VBN.by/IN)"); Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/SPARQL_Pair.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/SPARQL_Pair.java 2011-10-28 09:43:10 UTC (rev 3338) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/sparql/SPARQL_Pair.java 2011-10-28 14:01:16 UTC (rev 3339) @@ -43,7 +43,7 @@ case NEQ: return a + "!=" + b; case REGEX: - return "regex(" + a + "," + b + ")"; + return "regex(" + a + "," + b + ",'i')"; } return ""; } Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java 2011-10-28 09:43:10 UTC (rev 3338) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/SlotBuilder.java 2011-10-28 14:01:16 UTC (rev 3339) @@ -124,7 +124,7 @@ else if (pos.equals("JJNPREP")) { String jjtoken = token.substring(0,token.indexOf("_")); String nntoken = token.substring(token.indexOf("_")+1); - String slotfluent = "SLOT_" + tokenfluent + "/CLASS/" + token; + String slotfluent = "SLOT_" + tokenfluent + "/PROPERTY/" + token; String slotnn = "SLOT_" + nntoken + "/PROPERTY/" + nntoken; String slotnnc = "SLOT_" + nntoken + "/CLASS/" + nntoken; String slotjj = "SLOT_" + jjtoken + "/CLASS/" + jjtoken; Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/Templator.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/Templator.java 2011-10-28 09:43:10 UTC (rev 3338) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/Templator.java 2011-10-28 14:01:16 UTC (rev 3339) @@ -147,11 +147,11 @@ if (!containsModuloRenaming(drses,drs)) { // // DEBUG -// System.out.println(dude); -// System.out.println(drs); -// for (Slot sl : slots) { -// System.out.println(sl.toString()); -// } + System.out.println(dude); + System.out.println(drs); + for (Slot sl : slots) { + System.out.println(sl.toString()); + } // // drses.add(drs); @@ -190,7 +190,7 @@ } newwords = new ArrayList<String>(); - newwords.add(word); + newwords.addAll(slot.getWords()); newwords.addAll(strings); if (wordnetpos != null && !slot.getSlotType().equals(SlotType.RESOURCE)) { Modified: trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml =================================================================== --- trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml 2011-10-28 09:43:10 UTC (rev 3338) +++ trunk/components-ext/src/main/resources/tbsl/evaluation/dbpedia-test-questions-tagged(ideal).xml 2011-10-28 14:01:16 UTC (rev 3339) @@ -84,13 +84,13 @@ <string>Which/WDT European/JJ countries/NNS are/VBP a/DT constitutional/JJ monarchy/NN</string> </question> <question id="40"> -<string>Who/WP is/VBZ the/DT author/NN of/IN WikiLeaks/NNS</string> +<string>Who/WP is/VBZ the/DT author/NN of/IN WikiLeaks/NNP</string> </question> <question id="17"> <string>Which/WDT state/NN of/IN the/DT United/NNP States/NNPS of/IN America/NNP has/VBZ the/DT highest/JJS density/NN</string> </question> <question id="19"> -<string>What/WP is/VBZ the/DT currency/NN of/IN the/DT Czech/JJ Republic/NNP</string> +<string>What/WP is/VBZ the/DT currency/NN of/IN the/DT Czech/NNP Republic/NNP</string> </question> <question id="22"> <string>Which/WDT countries/NNS in/IN the/DT European/NNP Union/NNP adopted/VBD the/DT Euro/NNP</string> @@ -111,7 +111,7 @@ <string>When/WRB did/VBD Germany/NNP join/VB the/DT EU/NNP</string> </question> <question id="36"> -<string>Which/WDT monarchs/NNS of/IN the/DT United/NNP Kingdom/NNP were/VBD married/VBN to/TO a/DT German/JJ</string> +<string>Which/WDT monarchs/NNS of/IN the/DT United/NNP Kingdom/NNP were/VBD married/VBN to/TO a/DT German/NN</string> </question> <question id="8"> <string>When/WRB was/VBD the/DT Battle/NNP of/IN Gettysburg/NNP</string> Modified: trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex =================================================================== --- trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex 2011-10-28 09:43:10 UTC (rev 3338) +++ trunk/components-ext/src/main/resources/tbsl/lexicon/english.lex 2011-10-28 14:01:16 UTC (rev 3339) @@ -85,6 +85,9 @@ the most || (DET DET:'the' DET:'most') || <y, l1, e, [ l1:[ | l2:[ y | ] THEMOST y l3:[|] ] ], [], [],[]> the least || (DET DET:'the' DET:'least') || <y, l1, e, [ l1:[ | l2:[ y | ] THELEAST y l3:[|] ] ], [], [],[]> + // CHEAT! + highest || (NP ADJ:'highest' NP*) || <x, l1, e, [ l1:[ | maximum(a,x,x) ] ], [], [],[]> ;; <x, l1, e, [ l1:[ | SLOT_high(x), maximum(a,x,x) ] ],[],[],[ SLOT_high/PROPERTY/height^elevation ]> + // COUNT more than || (DP DET:'more' DET:'than' NUM[num] NP[np]) || <y,l1,<<e,t>,t>,[ l1:[ y,c | count(y,c), greater(c,z) ] ],[(l2,y,np,<e,t>),(l3,z,num,e)],[l2=l1,l3=l1],[]> ;; <y,l1,<<e,t>,t>,[ l1:[ y | greater(y,z) ] ],[(l2,y,np,<e,t>),(l3,z,num,e)],[l2=l1,l3=l1],[]> less than || (DP DET:'less' DET:'than' NUM[num] NP[np]) || <y,l1,<<e,t>,t>,[ l1:[ y,c | count(y,c), less(c,z) ] ],[(l2,y,np,<e,t>),(l3,z,num,e)],[l2=l1,l3=l1],[]> ;; <y,l1,<<e,t>,t>,[ l1:[ y | less(y,z) ] ],[(l2,y,np,<e,t>),(l3,z,num,e)],[l2=l1,l3=l1],[]> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2011-10-28 09:43:17
|
Revision: 3338 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3338&view=rev Author: kurzum Date: 2011-10-28 09:43:10 +0000 (Fri, 28 Oct 2011) Log Message: ----------- added validation report Added Paths: ----------- trunk/examples/validate trunk/examples/validationReport.txt Added: trunk/examples/validate =================================================================== --- trunk/examples/validate (rev 0) +++ trunk/examples/validate 2011-10-28 09:43:10 UTC (rev 3338) @@ -0,0 +1,9 @@ + + +for i in `find . | egrep '.owl$|.ttl|.nt$'` +do +echo "********************************" +echo $i +echo "********************************" +eyeball -assume owl -check $i +done Property changes on: trunk/examples/validate ___________________________________________________________________ Added: svn:executable + * Added: trunk/examples/validationReport.txt =================================================================== --- trunk/examples/validationReport.txt (rev 0) +++ trunk/examples/validationReport.txt 2011-10-28 09:43:10 UTC (rev 3338) @@ -0,0 +1,794 @@ +******************************** +./carcinogenesis/carcinogenesis.owl +******************************** + +On statement: :d307 :micronuc_f "false"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :micronuc_f + +On statement: :d80 :hasBond :bond8829 + predicate not declared in any schema: :hasBond + +On statement: :d80 :cytogen_ca "true"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :cytogen_ca + +On statement: :d279_1 :charge "-0.0050"^^http://www.w3.org/2001/XMLSchema#double + predicate not declared in any schema: :charge + +On statement: :d274 :drosophila_rt "false"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :drosophila_rt + +On statement: :d329 :salmonella_reduc "true"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :salmonella_reduc + +On statement: :d307 :micronuc_m "false"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :micronuc_m + +On statement: :d80 :hasAtom :d80_8 + predicate not declared in any schema: :hasAtom + +On statement: :bond7133 :inBond :d328a_15 + predicate not declared in any schema: :inBond + +On statement: :d80 :salmonella "true"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :salmonella + +On statement: :d80 :cytogen_sce "false"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :cytogen_sce + +On statement: :d80 :amesTestPositive "true"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :amesTestPositive + +On statement: :d274 :chromex "true"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :chromex + +On statement: :d274 :drosophila_slrl "true"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :drosophila_slrl + +On statement: :d80 :salmonella_n "true"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :salmonella_n + +On statement: :d43 :mouse_lymph "true"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :mouse_lymph + +On statement: :d80 :isMutagenic "false"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :isMutagenic + +On statement: :d274 :chromaberr "false"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :chromaberr + +On statement: :d80 :hasStructure :six_ring-2874 + predicate not declared in any schema: :hasStructure + +eye:multiplePrefixesForNamespace: "http://dl-learner.org/carcinogenesis#" + on prefix: "" + on prefix: "carcinogenesis" +******************************** +./lymphography/lymphography.owl +******************************** +******************************** +./tobiaswunner/lemon.owl +******************************** +Exception in thread "main" com.hp.hpl.jena.rdf.model.ResourceRequiredException: "1"^^http://www.w3.org/2001/XMLSchema#nonNegativeInteger + at com.hp.hpl.jena.rdf.model.impl.ResourceImpl$1.wrap(ResourceImpl.java:29) + at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:142) + at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:22) + at com.hp.hpl.jena.enhanced.Polymorphic.asInternal(Polymorphic.java:54) + at com.hp.hpl.jena.enhanced.EnhNode.as(EnhNode.java:97) + at com.hp.hpl.jena.extras.tools.query.QueryVariable.resource(QueryVariable.java:70) + at com.hp.hpl.jena.eyeball.inspectors.ListInspector.findPotentialSuspecListTypes(ListInspector.java:156) + at com.hp.hpl.jena.eyeball.inspectors.ListInspector.findSuspecListTypes(ListInspector.java:124) + at com.hp.hpl.jena.eyeball.inspectors.ListInspector.inspectModel(ListInspector.java:83) + at com.hp.hpl.jena.eyeball.Inspector$InspectorSet.inspectModel(Inspector.java:130) + at com.hp.hpl.jena.eyeball.Eyeball.inspect(Eyeball.java:77) + at jena.eyeball.inspectAndReport(eyeball.java:318) + at jena.eyeball.checkOneModel(eyeball.java:308) + at jena.eyeball.run(eyeball.java:103) + at jena.eyeball.main(eyeball.java:43) + at jena.eyeball.main(eyeball.java:34) + at jena.eyeball.main(eyeball.java:31) +******************************** +./tobiaswunner/corpus.ttl +******************************** + +On statement: kb:ex2 rdf:type str:String + class not declared in any schema: str:String + +On statement: kb:ex1 rdf:type str:Document + class not declared in any schema: str:Document + +eye:multiplePrefixesForNamespace: "http://nlp2rdf.lod2.eu/schema/sso/" + on prefix: "str" + on prefix: "sso" +******************************** +./tobiaswunner/string.owl +******************************** + +On statement: :beginIndex rdfs:Range xsd:int + not from schema: "http://www.w3.org/2000/01/rdf-schema#" + on resource: rdfs:Range + +On statement: _:b1001 owl:hasSelf "true"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: owl:hasSelf + +On statement: _:b1001 owl:hasSelf "true"^^http://www.w3.org/2001/XMLSchema#boolean + not from schema: "http://www.w3.org/2002/07/owl#" + on resource: owl:hasSelf + +On statement: :beginIndex rdfs:Range xsd:int + predicate not declared in any schema: rdfs:Range +******************************** +./tobiaswunner/sso.owl +******************************** + +eye:multiplePrefixesForNamespace: "http://nlp2rdf.lod2.eu/schema/sso/" + on prefix: "" + on prefix: "sso" +******************************** +./mutagenesis/mutagenesis.owl +******************************** + +On statement: :d73 :logp "2.68"^^http://www.w3.org/2001/XMLSchema#double + predicate not declared in any schema: :logp + +On statement: :d73 :lumo "-0.648"^^http://www.w3.org/2001/XMLSchema#double + predicate not declared in any schema: :lumo + +On statement: :d73 :act "-2.0"^^http://www.w3.org/2001/XMLSchema#double + predicate not declared in any schema: :act + +On statement: :bond3668 rdf:type owl:NamedIndividual + not from schema: "http://www.w3.org/2002/07/owl#" + on resource: owl:NamedIndividual + +On statement: :d137_21 :charge "0.142"^^http://www.w3.org/2001/XMLSchema#double + predicate not declared in any schema: :charge + +On statement: :d73 :hasThreeOrMoreFusedRings "false"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :hasThreeOrMoreFusedRings + +On statement: :d73 :hasAtom :d73_24 + predicate not declared in any schema: :hasAtom + +On statement: :d73 :hasFifeExamplesOfAcenthrylenes "false"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :hasFifeExamplesOfAcenthrylenes + +On statement: :d73 :hasBond :bond4673 + predicate not declared in any schema: :hasBond + +On statement: :bond3668 rdf:type owl:NamedIndividual + class not declared in any schema: owl:NamedIndividual + +On statement: :d73 :hasStructure :nitro-1291 + predicate not declared in any schema: :hasStructure + +On statement: :bond3668 :inBond :d43_5 + predicate not declared in any schema: :inBond + +eye:multiplePrefixesForNamespace: "http://dl-learner.org/mutagenesis#" + on prefix: "" + on prefix: "mutagenesis" +******************************** +./poker/pair50.owl +******************************** + +On statement: a:card104 a:nextRank a:card101 + predicate not declared in any schema: a:nextRank + +On statement: a:card125 a:hasRank a:ace + predicate not declared in any schema: a:hasRank + +On statement: a:card125 a:sameRank a:card129 + predicate not declared in any schema: a:sameRank + +On statement: a:card125 a:hasSuit a:diamonds + predicate not declared in any schema: a:hasSuit + +On statement: a:card125 a:sameSuit a:card128 + predicate not declared in any schema: a:sameSuit + +On statement: a:hand43 a:hasCard a:card219 + predicate not declared in any schema: a:hasCard +******************************** +./poker/straight.owl +******************************** + +On statement: a:card176 a:sameRank a:card179 + predicate not declared in any schema: a:sameRank + +On statement: a:hand51 a:hasCard a:card259 + predicate not declared in any schema: a:hasCard + +On statement: a:card248 a:nextRank a:card249 + predicate not declared in any schema: a:nextRank + +On statement: a:card152 a:hasSuit a:diamonds + predicate not declared in any schema: a:hasSuit + +On statement: a:card152 a:hasRank a:queen + predicate not declared in any schema: a:hasRank + +On statement: a:card152 a:sameSuit a:card154 + predicate not declared in any schema: a:sameSuit +******************************** +./nlp2rdf/sample/import.owl +******************************** + +eye:multiplePrefixesForNamespace: "http://www.w3.org/2002/07/owl#" + on prefix: "ns0" + on prefix: "owl" +******************************** +./nlp2rdf/sample/data2.owl +******************************** + +On statement: http://nlp2rdf.lod2.eu/nif/offset_91_96_apple j.0:AdjectivalModifier http://nlp2rdf.lod2.eu/nif/offset_85_90_eaten + predicate not declared in any schema: j.0:AdjectivalModifier + +On statement: http://nlp2rdf.lod2.eu/nif/offset_133_160_The+boy+will+eat+the sso:lastWord http://nlp2rdf.lod2.eu/nif/offset_159_160_. + predicate not declared in any schema: sso:lastWord + +On statement: http://nlp2rdf.lod2.eu/nif/offset_133_160_The+boy+will+eat+the sso:child http://nlp2rdf.lod2.eu/nif/offset_141_159_will+eat+the+apple + predicate not declared in any schema: sso:child + +On statement: http://nlp2rdf.lod2.eu/nif/offset_91_96_apple j.0:amod http://nlp2rdf.lod2.eu/nif/offset_85_90_eaten + predicate not declared in any schema: j.0:amod + +On statement: http://nlp2rdf.lod2.eu/nif/offset_14_19_eaten j.0:PassiveNominalSubject http://nlp2rdf.lod2.eu/nif/offset_4_9_apple + predicate not declared in any schema: j.0:PassiveNominalSubject + +On statement: http://nlp2rdf.lod2.eu/nif/offset_146_149_eat j.0:NominalSubject http://nlp2rdf.lod2.eu/nif/offset_137_140_boy + predicate not declared in any schema: j.0:NominalSubject + +On statement: http://nlp2rdf.lod2.eu/nif/offset_133_136_The sso:lemma "the" + predicate not declared in any schema: sso:lemma + +On statement: http://nlp2rdf.lod2.eu/nif/offset_133_136_The sso:oliaLink j.4:DT + predicate not declared in any schema: sso:oliaLink + +On statement: http://nlp2rdf.lod2.eu/nif/offset_14_19_eaten j.0:nsubjpass http://nlp2rdf.lod2.eu/nif/offset_4_9_apple + predicate not declared in any schema: j.0:nsubjpass + +On statement: http://nlp2rdf.lod2.eu/nif/offset_133_160_The+boy+will+eat+the sso:firstWord http://nlp2rdf.lod2.eu/nif/offset_133_136_The + predicate not declared in any schema: sso:firstWord + +On statement: http://nlp2rdf.lod2.eu/nif/offset_146_149_eat j.0:aux http://nlp2rdf.lod2.eu/nif/offset_141_145_will + predicate not declared in any schema: j.0:aux + +On statement: http://nlp2rdf.lod2.eu/nif/offset_14_19_eaten j.0:PassiveAuxiliary http://nlp2rdf.lod2.eu/nif/offset_10_13_was + predicate not declared in any schema: j.0:PassiveAuxiliary + +On statement: http://nlp2rdf.lod2.eu/nif/offset_133_160_The+boy+will+eat+the string:anchorOf "The boy will eat the apple." + predicate not declared in any schema: string:anchorOf + +On statement: http://nlp2rdf.lod2.eu/nif/offset_25_30_apple j.0:Determiner http://nlp2rdf.lod2.eu/nif/offset_21_24_The + predicate not declared in any schema: j.0:Determiner + +On statement: http://nlp2rdf.lod2.eu/nif/offset_146_149_eat j.0:DirectObject http://nlp2rdf.lod2.eu/nif/offset_154_159_apple + predicate not declared in any schema: j.0:DirectObject + +On statement: http://nlp2rdf.lod2.eu/nif/offset_101_106_clean j.0:Copula http://nlp2rdf.lod2.eu/nif/offset_97_100_was + predicate not declared in any schema: j.0:Copula + +On statement: http://nlp2rdf.lod2.eu/nif/offset_25_30_apple j.0:det http://nlp2rdf.lod2.eu/nif/offset_21_24_The + predicate not declared in any schema: j.0:det + +On statement: http://nlp2rdf.lod2.eu/nif/offset_146_149_eat j.0:nsubj http://nlp2rdf.lod2.eu/nif/offset_137_140_boy + predicate not declared in any schema: j.0:nsubj + +On statement: http://nlp2rdf.lod2.eu/nif/offset_133_136_The sso:posTag "DT" + predicate not declared in any schema: sso:posTag + +On statement: http://nlp2rdf.lod2.eu/nif/offset_14_19_eaten j.0:auxpass http://nlp2rdf.lod2.eu/nif/offset_10_13_was + predicate not declared in any schema: j.0:auxpass + +On statement: http://nlp2rdf.lod2.eu/nif/offset_133_136_The sso:nextWord http://nlp2rdf.lod2.eu/nif/offset_137_140_boy + predicate not declared in any schema: sso:nextWord + +On statement: http://nlp2rdf.lod2.eu/nif/offset_101_106_clean j.0:cop http://nlp2rdf.lod2.eu/nif/offset_97_100_was + predicate not declared in any schema: j.0:cop + +On statement: http://nlp2rdf.lod2.eu/nif/offset_0_161_The+apple+was+eaten. string:sourceString "The apple was eaten. +The apple has been eaten. +The apple was eaten and cleaned. + +The eaten apple was clean. +The apple ate the apple. +The boy will eat the apple. +" + predicate not declared in any schema: string:sourceString + +On statement: http://nlp2rdf.lod2.eu/nif/offset_133_160_The+boy+will+eat+the sso:word http://nlp2rdf.lod2.eu/nif/offset_154_159_apple + predicate not declared in any schema: sso:word + +On statement: http://nlp2rdf.lod2.eu/nif/offset_146_149_eat j.0:Auxiliary http://nlp2rdf.lod2.eu/nif/offset_141_145_will + predicate not declared in any schema: j.0:Auxiliary + +On statement: http://nlp2rdf.lod2.eu/nif/offset_146_149_eat j.0:dobj http://nlp2rdf.lod2.eu/nif/offset_154_159_apple + predicate not declared in any schema: j.0:dobj + +Jena generated prefix found: "j.4" + for namespace: "http://purl.org/olia/penn.owl#" + +Jena generated prefix found: "j.5" + for namespace: "http://purl.org/olia/olia-top.owl#" + +eye:multiplePrefixesForNamespace: "http://www.w3.org/2002/07/owl#" + on prefix: "ns0" + on prefix: "owl" + +Jena generated prefix found: "j.0" + for namespace: "http://purl.org/olia/stanford.owl#" + +Jena generated prefix found: "j.2" + for namespace: "http://purl.org/olia/system.owl#" + +Jena generated prefix found: "j.3" + for namespace: "http://purl.org/olia/olia.owl#" + +Jena generated prefix found: "j.1" + for namespace: "http://purl.org/olia/penn-syntax.owl#" + +eye:multiplePrefixesForNamespace: "http://nlp2rdf.lod2.eu/schema/string/" + on prefix: "str" + on prefix: "string" +******************************** +./nlp2rdf/sample/data1.owl +******************************** + +On statement: http://nlp2rdf.lod2.eu/nif/offset_104_107_eat j.0:aux http://nlp2rdf.lod2.eu/nif/offset_99_103_will + predicate not declared in any schema: j.0:aux + +On statement: http://nlp2rdf.lod2.eu/nif/offset_118_145_The+boy+has+eaten+th sso:word http://nlp2rdf.lod2.eu/nif/offset_144_145_. + predicate not declared in any schema: sso:word + +On statement: http://nlp2rdf.lod2.eu/nif/offset_118_145_The+boy+has+eaten+th sso:firstWord http://nlp2rdf.lod2.eu/nif/offset_118_121_The + predicate not declared in any schema: sso:firstWord + +On statement: http://nlp2rdf.lod2.eu/nif/offset_104_107_eat j.0:dobj http://nlp2rdf.lod2.eu/nif/offset_112_116_cake + predicate not declared in any schema: j.0:dobj + +On statement: http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten sso:lemma "eat" + predicate not declared in any schema: sso:lemma + +On statement: http://nlp2rdf.lod2.eu/nif/offset_118_145_The+boy+has+eaten+th sso:lastWord http://nlp2rdf.lod2.eu/nif/offset_144_145_. + predicate not declared in any schema: sso:lastWord + +On statement: http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten sso:oliaLink j.4:VBN + predicate not declared in any schema: sso:oliaLink + +On statement: http://nlp2rdf.lod2.eu/nif/offset_0_146_The+apple+is+eaten.%0A string:sourceString "The apple is eaten. +The apple has been eaten. +The apple was eaten. + +The boy eats the cake. +The boy will eat the cake. +The boy has eaten the cake. +" + predicate not declared in any schema: string:sourceString + +On statement: http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten sso:nextWord http://nlp2rdf.lod2.eu/nif/offset_18_19_. + predicate not declared in any schema: sso:nextWord + +On statement: http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten sso:child http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten + predicate not declared in any schema: sso:child + +On statement: http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten j.0:PassiveAuxiliary http://nlp2rdf.lod2.eu/nif/offset_10_12_is + predicate not declared in any schema: j.0:PassiveAuxiliary + +On statement: http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten sso:posTag "VBN" + predicate not declared in any schema: sso:posTag + +On statement: http://nlp2rdf.lod2.eu/nif/offset_104_107_eat j.0:Auxiliary http://nlp2rdf.lod2.eu/nif/offset_99_103_will + predicate not declared in any schema: j.0:Auxiliary + +On statement: http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten j.0:auxpass http://nlp2rdf.lod2.eu/nif/offset_10_12_is + predicate not declared in any schema: j.0:auxpass + +On statement: http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten j.0:nsubjpass http://nlp2rdf.lod2.eu/nif/offset_4_9_apple + predicate not declared in any schema: j.0:nsubjpass + +On statement: http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten j.0:PassiveNominalSubject http://nlp2rdf.lod2.eu/nif/offset_4_9_apple + predicate not declared in any schema: j.0:PassiveNominalSubject + +On statement: http://nlp2rdf.lod2.eu/nif/offset_104_107_eat j.0:NominalSubject http://nlp2rdf.lod2.eu/nif/offset_95_98_boy + predicate not declared in any schema: j.0:NominalSubject + +On statement: http://nlp2rdf.lod2.eu/nif/offset_104_107_eat j.0:DirectObject http://nlp2rdf.lod2.eu/nif/offset_112_116_cake + predicate not declared in any schema: j.0:DirectObject + +On statement: http://nlp2rdf.lod2.eu/nif/offset_50_55_apple j.0:det http://nlp2rdf.lod2.eu/nif/offset_46_49_The + predicate not declared in any schema: j.0:det + +On statement: http://nlp2rdf.lod2.eu/nif/offset_50_55_apple j.0:Determiner http://nlp2rdf.lod2.eu/nif/offset_46_49_The + predicate not declared in any schema: j.0:Determiner + +On statement: http://nlp2rdf.lod2.eu/nif/offset_104_107_eat j.0:nsubj http://nlp2rdf.lod2.eu/nif/offset_95_98_boy + predicate not declared in any schema: j.0:nsubj + +On statement: http://nlp2rdf.lod2.eu/nif/offset_13_18_eaten string:anchorOf "eaten" + predicate not declared in any schema: string:anchorOf + +eye:multiplePrefixesForNamespace: "http://www.w3.org/2002/07/owl#" + on prefix: "ns0" + on prefix: "owl" + +Jena generated prefix found: "j.4" + for namespace: "http://purl.org/olia/penn.owl#" + +Jena generated prefix found: "j.0" + for namespace: "http://purl.org/olia/stanford.owl#" + +Jena generated prefix found: "j.2" + for namespace: "http://purl.org/olia/system.owl#" + +Jena generated prefix found: "j.1" + for namespace: "http://purl.org/olia/penn-syntax.owl#" + +eye:multiplePrefixesForNamespace: "http://nlp2rdf.lod2.eu/schema/string/" + on prefix: "str" + on prefix: "string" + +Jena generated prefix found: "j.5" + for namespace: "http://purl.org/olia/olia-top.owl#" + +Jena generated prefix found: "j.3" + for namespace: "http://purl.org/olia/olia.owl#" +******************************** +./trains/trains2.owl +******************************** + +On statement: _:b1001 owl:members _:b1002 + predicate not declared in any schema: owl:members + +On statement: :east5 :hasCar :car_53 + predicate not declared in any schema: :hasCar + +On statement: :car_51 :hasShape :rectangle + predicate not declared in any schema: :hasShape + +On statement: _:b1001 rdf:type owl:AllDisjointClasses + not from schema: "http://www.w3.org/2002/07/owl#" + on resource: owl:AllDisjointClasses + +On statement: :car_51 :load :triangle + predicate not declared in any schema: :load + +On statement: :car_51 :wheels :two + predicate not declared in any schema: :wheels + +On statement: _:b1001 owl:members _:b1002 + not from schema: "http://www.w3.org/2002/07/owl#" + on resource: owl:members + +On statement: :car_51 :loadCount :one + predicate not declared in any schema: :loadCount + +On statement: _:b1001 rdf:type owl:AllDisjointClasses + class not declared in any schema: owl:AllDisjointClasses + +eye:multiplePrefixesForNamespace: "http://example.com/trains#" + on prefix: "" + on prefix: "trains" +******************************** +./trains/trains.owl +******************************** + +On statement: foo:car_94 foo:load foo:circle + predicate not declared in any schema: foo:load + +On statement: foo:car_94 foo:wheels foo:two + predicate not declared in any schema: foo:wheels + +On statement: foo:west10 foo:has_car foo:car_102 + predicate not declared in any schema: foo:has_car + +On statement: foo:u_shaped rdf:type foo:shape + class not declared in any schema: foo:shape + +On statement: foo:car_94 foo:hasShape foo:u_shaped + predicate not declared in any schema: foo:hasShape + +On statement: foo:car_94 foo:load_count foo:one + predicate not declared in any schema: foo:load_count +******************************** +./moral_reasoner/moral_43instances.owl +******************************** +******************************** +./moral_reasoner/moral.owl +******************************** +******************************** +./moral_reasoner/moral_43instances_complex.owl +******************************** +******************************** +./yinyang_examples/basicFamily.owl +******************************** + +On statement: :Anna :hasSibling :NonnoLuigi + predicate not declared in any schema: :hasSibling + +On statement: :Dino :hasParent :NonnaLina + predicate not declared in any schema: :hasParent + +On statement: :Gianni :hasChild :Rosanna + predicate not declared in any schema: :hasChild +******************************** +./corpus5/lemon.owl +******************************** +Exception in thread "main" com.hp.hpl.jena.rdf.model.ResourceRequiredException: "1"^^http://www.w3.org/2001/XMLSchema#nonNegativeInteger + at com.hp.hpl.jena.rdf.model.impl.ResourceImpl$1.wrap(ResourceImpl.java:29) + at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:142) + at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:22) + at com.hp.hpl.jena.enhanced.Polymorphic.asInternal(Polymorphic.java:54) + at com.hp.hpl.jena.enhanced.EnhNode.as(EnhNode.java:97) + at com.hp.hpl.jena.extras.tools.query.QueryVariable.resource(QueryVariable.java:70) + at com.hp.hpl.jena.eyeball.inspectors.ListInspector.findPotentialSuspecListTypes(ListInspector.java:156) + at com.hp.hpl.jena.eyeball.inspectors.ListInspector.findSuspecListTypes(ListInspector.java:124) + at com.hp.hpl.jena.eyeball.inspectors.ListInspector.inspectModel(ListInspector.java:83) + at com.hp.hpl.jena.eyeball.Inspector$InspectorSet.inspectModel(Inspector.java:130) + at com.hp.hpl.jena.eyeball.Eyeball.inspect(Eyeball.java:77) + at jena.eyeball.inspectAndReport(eyeball.java:318) + at jena.eyeball.checkOneModel(eyeball.java:308) + at jena.eyeball.run(eyeball.java:103) + at jena.eyeball.main(eyeball.java:43) + at jena.eyeball.main(eyeball.java:34) + at jena.eyeball.main(eyeball.java:31) +******************************** +./corpus5/corpus.ttl +******************************** + +On statement: :Sense_Equity lemon:reference fin:Equity + predicate not declared in any schema: lemon:reference + +On statement: :LE_FixedAssets rdf:type lemon:LexicalEntry + class not declared in any schema: lemon:LexicalEntry + +On statement: :lexicon rdf:type lemon:Lexicon + class not declared in any schema: lemon:Lexicon + +On statement: :mv100m_sen3 fin:Amount "100"^^http://www.w3.org/2001/XMLSchema#double + predicate not declared in any schema: fin:Amount + +On statement: :mv100m_sen3 rdf:type fin:MonetaryValue + class not declared in any schema: fin:MonetaryValue + +On statement: :lexicon lemon:entry :LE_Equity + predicate not declared in any schema: lemon:entry + +On statement: :sen3 :annotation :mv100m_sen3 + predicate not declared in any schema: :annotation + +On statement: :Sense_Equity rdf:type lemon:LexicalSense + class not declared in any schema: lemon:LexicalSense +******************************** +./semantic_bible/NTNcombined.owl +******************************** + +On statement: :ManassehThePatriarch :siblingOf :Gad + predicate not declared in any schema: :siblingOf + +On statement: :GaiusOfMacedonia :visitedPlace :Ephesus + predicate not declared in any schema: :visitedPlace + +On statement: :Barak :name_en "Barak"^^http://www.w3.org/2001/XMLSchema#string + predicate not declared in any schema: :name_en + +On statement: :Derbe :location :DerbeGeodata + predicate not declared in any schema: :location + +On statement: :JohnOfTheSanhedrin :memberOf :Sanhedrin + predicate not declared in any schema: :memberOf + +On statement: :Paul :hasEnemy :Felix + predicate not declared in any schema: :hasEnemy + +On statement: :TribeOfBenjamin :member :SaulSonOfKish + predicate not declared in any schema: :member + +On statement: :Clement :religiousBelief :Christianity + predicate not declared in any schema: :religiousBelief + +On statement: :Ananias :hasAntagonist :SimonPeter + predicate not declared in any schema: :hasAntagonist + +On statement: :AmphipolisGeodata :locationOf :Amphipolis + predicate not declared in any schema: :locationOf + +On statement: :Athens :residentPlaceOf :Damaris + predicate not declared in any schema: :residentPlaceOf + +On statement: :Roman :ethnicityOf :Cornelius + predicate not declared in any schema: :ethnicityOf + +On statement: :PaphosGeodata :altitude 0 + predicate not declared in any schema: :altitude + +On statement: :HerodAntipas :enemyOf :Jesus + predicate not declared in any schema: :enemyOf + +On statement: :Gamaliel :nativePlace :Israel + predicate not declared in any schema: :nativePlace + +On statement: :Samaria :subregion :Sychar + predicate not declared in any schema: :subregion + +On statement: :Isaac :hasOnlyGenealogyMention "false"^^http://www.w3.org/2001/XMLSchema#boolean + predicate not declared in any schema: :hasOnlyGenealogyMention + +On statement: :GaiusOfMacedonia :possiblySamePersonAs :GaiusOfDerbe + predicate not declared in any schema: :possiblySamePersonAs + +On statement: :Andrew :relativeOf :SimonTheZealot + predicate not declared in any schema: :relativeOf + +On statement: :Bethphage :subregionOf :Judea + predicate not declared in any schema: :subregionOf + +On statement: :Balak :description "king of Moab who hired Balaam"^^http://www.w3.org/2001/XMLSchema#string + predicate not declared in any schema: :description + +On statement: :PaphosGeodata :longitude "32.42822722601693"^^http://www.w3.org/2001/XMLSchema#double + predicate not declared in any schema: :longitude + +On statement: :Diotrephes :antagonistOf :JohnSonOfZebedee + predicate not declared in any schema: :antagonistOf + +On statement: :Blastus :knows :HerodAgrippaI + predicate not declared in any schema: :knows + +On statement: :Clement :collaboratesWith :Syntyche + predicate not declared in any schema: :collaboratesWith + +On statement: :Isaac :spouseOf :Rebecca + predicate not declared in any schema: :spouseOf + +On statement: :Damaris :residentPlace :Athens + predicate not declared in any schema: :residentPlace + +On statement: :Derbe :nativePlaceOf :GaiusOfDerbe + predicate not declared in any schema: :nativePlaceOf + +On statement: :PaphosGeodata :latitude "34.77011113075128"^^http://www.w3.org/2001/XMLSchema#double + predicate not declared in any schema: :latitude + +On statement: :Jerusalem :visitedPlaceOf :Mary + predicate not declared in any schema: :visitedPlaceOf + +On statement: :ManassehThePatriarch :childOf :Jacob + predicate not declared in any schema: :childOf + +On statement: :Balak :ethnicity :Moabite + predicate not declared in any schema: :ethnicity + +On statement: :Isaac :parentOf :Esau + predicate not declared in any schema: :parentOf + +On statement: :Balak :occupation "king"^^http://www.w3.org/2001/XMLSchema#string + predicate not declared in any schema: :occupation +******************************** +./father.owl +******************************** + +On statement: :martin :hasChild :heinz + predicate not declared in any schema: :hasChild +******************************** +./forte/forte_family.owl +******************************** + +On statement: a:nero a:sibling a:janet + predicate not declared in any schema: a:sibling + +On statement: a:alice a:married a:art + predicate not declared in any schema: a:married + +On statement: a:nero a:parent a:ray + predicate not declared in any schema: a:parent +******************************** +./family/uncle.owl +******************************** + +On statement: a:alfred a:hasSibling a:maria + predicate not declared in any schema: a:hasSibling + +On statement: a:alfred a:married a:katrin + predicate not declared in any schema: a:married + +On statement: a:alfred a:hasChild a:hans + predicate not declared in any schema: a:hasChild +******************************** +./family/father_oe.owl +******************************** + +On statement: :martin :hasChild :heinz + predicate not declared in any schema: :hasChild + +eye:multiplePrefixesForNamespace: "http://example.com/father#" + on prefix: "" + on prefix: "father" +******************************** +./family/father.owl +******************************** + +On statement: :martin :hasChild :heinz + predicate not declared in any schema: :hasChild +******************************** +./datatypes/string.owl +******************************** + +On statement: :nt5 :noType "test" + predicate not declared in any schema: :noType + +On statement: :tl5 :typedLiteral "test"^^http://www.w3.org/2001/XMLSchema#string + predicate not declared in any schema: :typedLiteral + +eye:multiplePrefixesForNamespace: "http://my.example.com/string#" + on prefix: "" + on prefix: "string" +******************************** +./datatypes/double.owl +******************************** + +On statement: :susan :height "1.86"^^http://www.w3.org/2001/XMLSchema#double + predicate not declared in any schema: :height + +eye:multiplePrefixesForNamespace: "http://dl-learner.org/examples/double#" + on prefix: "" + on prefix: "double" +******************************** +./sparql/jamendo.owl +******************************** +ERROR [main] (RDFDefaultErrorHandler.java:44) - file:./sparql/jamendo.owl(line 1 column 1): Content is not allowed in prolog. +Exception in thread "main" com.hp.hpl.jena.shared.JenaException: org.xml.sax.SAXParseException: Content is not allowed in prolog. + at com.hp.hpl.jena.rdf.model.impl.RDFDefaultErrorHandler.fatalError(RDFDefaultErrorHandler.java:45) + at com.hp.hpl.jena.rdf.arp.impl.ARPSaxErrorHandler.fatalError(ARPSaxErrorHandler.java:35) + at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.warning(XMLHandler.java:225) + at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.fatalError(XMLHandler.java:255) + at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) + at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) + at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) + at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) + at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source) + at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) + at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) + at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) + at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) + at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) + at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:107) + at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:158) + at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:145) + at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:215) + at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:226) + at com.hp.hpl.jena.util.FileManager.readModelWorker(FileManager.java:394) + at com.hp.hpl.jena.util.FileManager.loadModelWorker(FileManager.java:299) + at com.hp.hpl.jena.util.FileManager.loadModel(FileManager.java:250) + at com.hp.hpl.jena.eyeball.loaders.FileLoader.load(FileLoader.java:39) + at com.hp.hpl.jena.eyeball.loaders.JDBCSensitiveLoader.load(JDBCSensitiveLoader.java:42) + at com.hp.hpl.jena.eyeball.loaders.OntLoader.ontLoad(OntLoader.java:56) + at jena.eyeball.checkOneModel(eyeball.java:304) + at jena.eyeball.run(eyeball.java:103) + at jena.eyeball.main(eyeball.java:43) + at jena.eyeball.main(eyeball.java:34) + at jena.eyeball.main(eyeball.java:31) +Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog. + at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) + ... 26 more +******************************** +./arch/arch.owl +******************************** + +On statement: :p5 :touches :p6 + predicate not declared in any schema: :touches + +On statement: :p7 :leftof :p8 + predicate not declared in any schema: :leftof + +On statement: :p8 :supports :d + predicate not declared in any schema: :supports + +On statement: :c1 :hasParallelpipe :a + predicate not declared in any schema: :hasParallelpipe + +On statement: :c1 :hasPillar :p1 + predicate not declared in any schema: :hasPillar + +eye:multiplePrefixesForNamespace: "http://localhost/foo#" + on prefix: "" + on prefix: "foo" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-10-28 08:44:13
|
Revision: 3337 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3337&view=rev Author: lorenz_b Date: 2011-10-28 08:44:07 +0000 (Fri, 28 Oct 2011) Log Message: ----------- Updated POS tagger eval script. Modified Paths: -------------- trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/POSTaggerEvaluation.java Modified: trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/POSTaggerEvaluation.java =================================================================== --- trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/POSTaggerEvaluation.java 2011-10-27 13:32:21 UTC (rev 3336) +++ trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/POSTaggerEvaluation.java 2011-10-28 08:44:07 UTC (rev 3337) @@ -5,24 +5,47 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Set; import org.dllearner.algorithm.tbsl.nlp.ApachePartOfSpeechTagger; import org.dllearner.algorithm.tbsl.nlp.LingPipePartOfSpeechTagger; import org.dllearner.algorithm.tbsl.nlp.PartOfSpeechTagger; import org.dllearner.algorithm.tbsl.nlp.StanfordPartOfSpeechTagger; +import org.nlp2rdf.ontology.olia.OLiAManager; +import org.nlp2rdf.ontology.olia.OLiAOntology; import com.aliasi.corpus.ObjectHandler; import com.aliasi.corpus.StringParser; import com.aliasi.tag.Tagging; import com.aliasi.util.Strings; +import com.hp.hpl.jena.ontology.OntClass; +import com.hp.hpl.jena.ontology.OntModel; +import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; +import com.hp.hpl.jena.util.iterator.Filter; public class POSTaggerEvaluation extends StringParser<ObjectHandler<Tagging<String>>>{ private List<PartOfSpeechTagger> taggers = Arrays.asList(new PartOfSpeechTagger[]{ new ApachePartOfSpeechTagger(), new StanfordPartOfSpeechTagger(), new LingPipePartOfSpeechTagger()}); + private OLiAManager m = new OLiAManager(); + private OLiAOntology brown; + private OLiAOntology penn; + + private static final String OLIA_NS = "http://purl.org/olia/olia.owl"; + + private Filter<OntClass> olia_filter = new Filter<OntClass>() { + @Override + public boolean accept(OntClass oc) { + return oc.getURI().startsWith(OLIA_NS); + } + }; + public POSTaggerEvaluation() { + brown = m.getOLiAOntology("http://purl.org/olia/brown-link.rdf"); + penn = m.getOLiAOntology("http://purl.org/olia/penn-link.rdf"); } public void run(File directory){ @@ -146,10 +169,8 @@ for(int i = 0; i < referenceTagging.tags().size(); i++){ referenceTag = referenceTagging.tags().get(i); tag = tagging.tags().get(i); - if(!referenceTag.equalsIgnoreCase(tag)){ -// System.out.println(referenceTag + "--" + tag); - errorCnt++; - } + boolean matches = matchesOLiaClass(referenceTag, tag); + System.out.println(matches); } if(errorCnt > 0){ System.out.println(tagging); @@ -157,6 +178,38 @@ } } + /* + * Returns TRUE if in the OLia hierarchy is somewhere a common class. + */ + private boolean matchesOLiaClass(String brownTag, String pennTag){ + Set<String> brownClasses = brown.getClassURIsForTag(brownTag.toUpperCase()); + Set<String> pennClasses = penn.getClassURIsForTag(pennTag); + + System.out.println(brownTag + "-BROWN:" + brownClasses); + System.out.println(pennTag + "-PENN:" + pennClasses); + + OntModel brownModel = ModelFactory.createOntologyModel(); + OntModel pennModel = ModelFactory.createOntologyModel(); + + for (String classUri : brownClasses) { + brownModel.add(brown.getHierarchy(classUri)); + } + + for (String classUri : pennClasses) { + pennModel.add(penn.getHierarchy(classUri)); + } + + for(OntClass oc1 : brownModel.listClasses().filterKeep(olia_filter).toList()){ + for(OntClass oc2 : pennModel.listClasses().filterKeep(olia_filter).toList()){ + if(oc1.equals(oc2)){ + return true; + } + } + } + + return false; + } + public static void main(String[] args) { POSTaggerEvaluation eval = new POSTaggerEvaluation(); eval.run(new File(args[0])); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-10-27 13:32:27
|
Revision: 3336 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3336&view=rev Author: jenslehmann Date: 2011-10-27 13:32:21 +0000 (Thu, 27 Oct 2011) Log Message: ----------- example conf file (new syntax) Added Paths: ----------- trunk/test/pdb/1XFF.A.Asparagine.conf Added: trunk/test/pdb/1XFF.A.Asparagine.conf =================================================================== --- trunk/test/pdb/1XFF.A.Asparagine.conf (rev 0) +++ trunk/test/pdb/1XFF.A.Asparagine.conf 2011-10-27 13:32:21 UTC (rev 3336) @@ -0,0 +1,25 @@ + +// declare some prefixes to use as abbreviations +prefixes = [ ("pdb","http://bio2rdf.org/pdb:1XFF/") ] + +// knowledge source definition +ks.type = "OWL File" +ks.fileName = "AA_properties.owl" + +ks2.type = "OWL File" +ks2.fileName = "1XFF/1XFF.A.rdf" + +// reasoner +reasoner.type = "fast instance checker" +reasoner.sources = { ks2 } + +// learning problem +lp.type = "posNegStandard" +lp.positiveExamples = { "pdb:chemicalComponent_A103", "pdb:chemicalComponent_A132" } +lp.negativeExamples = { "pdb:chemicalComponent_A84", "pdb:chemicalComponent_A98", "pdb:chemicalComponent_A187", "pdb:chemicalComponent_A220", "pdb:chemicalComponent_A237"} + +// create learning algorithm to run +alg.type = "celoe" +alg.maxExecutionTimeInSeconds = 10 +// alg.writeSearchTree = true + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-10-27 13:30:18
|
Revision: 3335 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3335&view=rev Author: jenslehmann Date: 2011-10-27 13:30:12 +0000 (Thu, 27 Oct 2011) Log Message: ----------- enabled some constructors Modified Paths: -------------- trunk/scripts/src/main/java/org/dllearner/examples/pdb/PDBDLLearner.java Modified: trunk/scripts/src/main/java/org/dllearner/examples/pdb/PDBDLLearner.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/examples/pdb/PDBDLLearner.java 2011-10-27 13:01:30 UTC (rev 3334) +++ trunk/scripts/src/main/java/org/dllearner/examples/pdb/PDBDLLearner.java 2011-10-27 13:30:12 UTC (rev 3335) @@ -159,10 +159,10 @@ // configure target language RhoDRDown rho = new RhoDRDown(); rho.setReasoner(r); - rho.setUseAllConstructor(false); + rho.setUseAllConstructor(true); rho.setUseExistsConstructor(true); - rho.setUseNegation(false); - rho.setUseCardinalityRestrictions(false); + rho.setUseNegation(true); + rho.setUseCardinalityRestrictions(true); rho.init(); // configure learning algorithm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-10-27 13:01:41
|
Revision: 3334 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3334&view=rev Author: lorenz_b Date: 2011-10-27 13:01:30 +0000 (Thu, 27 Oct 2011) Log Message: ----------- Added yago index url. Modified Paths: -------------- trunk/components-ext/src/main/resources/tbsl/tbsl.properties Modified: trunk/components-ext/src/main/resources/tbsl/tbsl.properties =================================================================== --- trunk/components-ext/src/main/resources/tbsl/tbsl.properties 2011-10-27 11:57:25 UTC (rev 3333) +++ trunk/components-ext/src/main/resources/tbsl/tbsl.properties 2011-10-27 13:01:30 UTC (rev 3334) @@ -1,6 +1,8 @@ solr.server.url = http://139.18.2.173:8080/apache-solr-3.3.0 solr.classes.url = ${solr.server.url}/dbpedia_classes solr.classes.searchfield = label +solr.yago.classes.url = ${solr.server.url}/yago_classes +solr.yago.classes.searchfield = label solr.resources.url = ${solr.server.url}/dbpedia_resources solr.resources.searchfield = label solr.properties.url = ${solr.server.url}/dbpedia_properties This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-10-27 11:57:31
|
Revision: 3333 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3333&view=rev Author: lorenz_b Date: 2011-10-27 11:57:25 +0000 (Thu, 27 Oct 2011) Log Message: ----------- Updated eval script. Started POS tagger eval script. Modified Paths: -------------- trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/Evaluation.java Added Paths: ----------- trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/POSTaggerEvaluation.java Modified: trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/Evaluation.java =================================================================== --- trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/Evaluation.java 2011-10-27 11:32:56 UTC (rev 3332) +++ trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/Evaluation.java 2011-10-27 11:57:25 UTC (rev 3333) @@ -1,8 +1,10 @@ package org.dllearner.algorithm.tbsl; +import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.FileWriter; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; @@ -10,6 +12,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -26,7 +29,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import org.aksw.commons.jena.ExtendedQueryEngineHTTP; import org.apache.log4j.FileAppender; import org.apache.log4j.Layout; import org.apache.log4j.Level; @@ -51,7 +53,6 @@ import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.rdf.model.RDFNode; import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP; -import com.hp.hpl.jena.sparql.sse.builders.BuilderExpr.Build; import com.hp.hpl.jena.sparql.vocabulary.FOAF; import com.hp.hpl.jena.vocabulary.RDF; import com.hp.hpl.jena.vocabulary.RDFS; @@ -60,6 +61,7 @@ private static Logger logger = Logger.getLogger(Evaluation.class); private static String PROPERTIES_PATH = "tbsl/evaluation/evaluation.properties"; + private static final boolean USE_IDEAL_TAGGER = true; private SortedMap<Integer, String> id2Question = new TreeMap<Integer, String>(); private SortedMap<Integer, String> id2Query = new TreeMap<Integer, String>(); @@ -74,11 +76,13 @@ private ExtractionDBCache cache = new ExtractionDBCache("cache"); + public Evaluation(File ... evaluationFiles) throws FileNotFoundException, IOException{ for(File file : evaluationFiles){ readQueries(file); } stbl = new SPARQLTemplateBasedLearner(); + stbl.setUseIdealTagger(USE_IDEAL_TAGGER); init(); @@ -133,6 +137,7 @@ String question; String query; Set<String> answers; + for(int i = 0; i < questionNodes.getLength(); i++){ Element questionNode = (Element) questionNodes.item(i); //read question ID @@ -163,6 +168,20 @@ } catch (IOException e) { e.printStackTrace(); } + StringBuilder sb = new StringBuilder(); + for(Entry<Integer, String> e : id2Question.entrySet()){ + sb.append(e.getKey()+ ": " + extractSentence(e.getValue()) + "\n"); + } + try { + BufferedWriter out = new BufferedWriter(new FileWriter("questions.txt")); + out.write(sb.toString()); + out.close(); + } + catch (IOException e) + { + System.out.println("Exception "); + + } logger.info("Done."); } @@ -208,14 +227,16 @@ answer = new HashSet<String>(); if(!query.contains("LIMIT")){ query = query + " LIMIT 500"; - }System.out.println(query); + } ResultSet rs = executeSelect(query); + String variable; if(rs.getResultVars().size() == 1){ variable = rs.getResultVars().get(0); } else { variable = targetVar; } + variable = rs.getResultVars().get(0); QuerySolution qs; RDFNode node; @@ -290,7 +311,7 @@ String errorCode = ""; LatexWriter latex = new LatexWriter(); int i = 0; - for(Entry<Integer, String> entry : id2Question.entrySet()){ + for(Entry<Integer, String> entry : id2Question.entrySet()){if(entry.getKey()==50)continue; if(testID != -1 && entry.getKey() != testID)continue; try { questionId = entry.getKey(); @@ -306,7 +327,7 @@ //write new section for query - latex.beginSection(question); + latex.beginSection(extractSentence(question)); //write subsection for target latex.beginSubsection("Target"); //write subsubsection for target query @@ -367,6 +388,7 @@ k++; } + //get the URIs for each template slot latex.beginSubsection("Covered entities"); Map<Slot, List<String>> slot2URIsMap = stbl.getSlot2URIs(); @@ -411,7 +433,13 @@ for(String uri : slot2URI.getValue()){ uris.append(escapeString(getPrefixedURI(uri))).append(", "); } - sb.append(slot2URI.getKey().getWords() + "[" + slot2URI.getKey().getSlotType() + "]").append(" & ").append(uris.toString()).append("\\\\\\hline\n"); + StringBuilder slotWords = new StringBuilder(); + slotWords.append("["); + for(String word : slot2URI.getKey().getWords()){ + slotWords.append(escapeString(word)).append(", "); + } + slotWords.append("]"); + sb.append(slotWords.toString() + "[" + slot2URI.getKey().getSlotType() + "]").append(" & ").append(uris.toString()).append("\\\\\\hline\n"); } } sb.append("\\end{tabular}\n"); @@ -427,17 +455,17 @@ precision = computePrecision(targetAnswer, learnedAnswer); recall = computeRecall(targetAnswer, learnedAnswer); } - latex.addSummaryTableEntry(questionId, question, precision, recall, errorCode); + latex.addSummaryTableEntry(questionId, extractSentence(question), precision, recall, errorCode); } catch (NoTemplateFoundException e) { e.printStackTrace(); logger.error("Template generation failed"); errorCode = "NT"; - latex.addSummaryTableEntry(questionId, question, precision, recall, errorCode); + latex.addSummaryTableEntry(questionId, extractSentence(question), precision, recall, errorCode); } catch(Exception e){ e.printStackTrace(); logger.error("ERROR"); - latex.addSummaryTableEntry(questionId, question, precision, recall, errorCode); + latex.addSummaryTableEntry(questionId, extractSentence(question), precision, recall, errorCode); } } latex.write("log/evaluation.tex"); @@ -639,7 +667,7 @@ } } latex.endDocument(); - latex.write("log/evaluation.tex"); + latex.write("log/evaluation" + new Date().getHours() + "_" + new Date().getMinutes() + ".tex"); } private String escapeAnswerString(Object learnedAnswer, Object targetAnswer){ @@ -695,6 +723,24 @@ } } + + private String extractSentence(String taggedSentence){ + int pos = taggedSentence.indexOf("/"); + while(pos != -1){ + String first = taggedSentence.substring(0, pos); + int endPos = taggedSentence.substring(pos).indexOf(" "); + if(endPos == -1){ + endPos = taggedSentence.substring(pos).length(); + } + String rest = taggedSentence.substring(pos + endPos); + + taggedSentence = first + rest; + pos = taggedSentence.indexOf("/"); + + } + return taggedSentence; + + } /** * @param args * @throws IOException Added: trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/POSTaggerEvaluation.java =================================================================== --- trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/POSTaggerEvaluation.java (rev 0) +++ trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/POSTaggerEvaluation.java 2011-10-27 11:57:25 UTC (rev 3333) @@ -0,0 +1,166 @@ +package org.dllearner.algorithm.tbsl; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.dllearner.algorithm.tbsl.nlp.ApachePartOfSpeechTagger; +import org.dllearner.algorithm.tbsl.nlp.LingPipePartOfSpeechTagger; +import org.dllearner.algorithm.tbsl.nlp.PartOfSpeechTagger; +import org.dllearner.algorithm.tbsl.nlp.StanfordPartOfSpeechTagger; + +import com.aliasi.corpus.ObjectHandler; +import com.aliasi.corpus.StringParser; +import com.aliasi.tag.Tagging; +import com.aliasi.util.Strings; + +public class POSTaggerEvaluation extends StringParser<ObjectHandler<Tagging<String>>>{ + + private List<PartOfSpeechTagger> taggers = Arrays.asList(new PartOfSpeechTagger[]{ + new ApachePartOfSpeechTagger(), new StanfordPartOfSpeechTagger(), new LingPipePartOfSpeechTagger()}); + + + public POSTaggerEvaluation() { + } + + public void run(File directory){ + // train on files in data directory + File[] files = directory.listFiles(); + for (File file : files) { + System.out.println("Training file=" + file); + try { + parse(file); + } catch (IOException e) { + e.printStackTrace(); + } + break; + } + } + + @Override + public void parseString(char[] cs, int start, int end) { + String in = new String(cs,start,end-start); + String[] sentences = in.split("\n"); + for (int i = 0; i < sentences.length; ++i){ + if (!Strings.allWhitespace(sentences[i])){ + processSentence(sentences[i]); + } + } + } + + public String normalizeTag(String rawTag) { + String tag = rawTag; + String startTag = tag; + // remove plus, default to first + int splitIndex = tag.indexOf('+'); + if (splitIndex >= 0) + tag = tag.substring(0,splitIndex); + + int lastHyphen = tag.lastIndexOf('-'); + if (lastHyphen >= 0) { + String first = tag.substring(0,lastHyphen); + String suffix = tag.substring(lastHyphen+1); + if (suffix.equalsIgnoreCase("HL") + || suffix.equalsIgnoreCase("TL") + || suffix.equalsIgnoreCase("NC")) { + tag = first; + } + } + + int firstHyphen = tag.indexOf('-'); + if (firstHyphen > 0) { + String prefix = tag.substring(0,firstHyphen); + String rest = tag.substring(firstHyphen+1); + if (prefix.equalsIgnoreCase("FW") + || prefix.equalsIgnoreCase("NC") + || prefix.equalsIgnoreCase("NP")) + tag = rest; + } + + // neg last, and only if not whole thing + int negIndex = tag.indexOf('*'); + if (negIndex > 0) { + if (negIndex == tag.length()-1) + tag = tag.substring(0,negIndex); + else + tag = tag.substring(0,negIndex) + + tag.substring(negIndex+1); + } + // multiple runs to normalize + return tag.equals(startTag) ? tag : normalizeTag(tag); + } + + private String extractSentence(String taggedSentence){ + int pos = taggedSentence.indexOf("/"); + int i = 0; + while(pos != -1){ + String first = taggedSentence.substring(0, pos); + int endPos = taggedSentence.substring(pos).indexOf(" "); + if(endPos == -1){ + endPos = taggedSentence.substring(pos).length(); + } + String rest = taggedSentence.substring(pos + endPos); + + taggedSentence = first + rest; + pos = taggedSentence.indexOf("/"); + +// if(i++ == 22)break; + } + return taggedSentence; + + } + + private void processSentence(String taggedSentence) { + String[] tagTokenPairs = taggedSentence.split(" "); + List<String> tokenList = new ArrayList<String>(tagTokenPairs.length); + List<String> tagList = new ArrayList<String>(tagTokenPairs.length); + + for (String pair : tagTokenPairs) { + int j = pair.lastIndexOf('/'); + String token = pair.substring(0,j); + String tag = normalizeTag(pair.substring(j+1)); + tokenList.add(token); + tagList.add(tag); + } + Tagging<String> tagging = new Tagging<String>(tokenList,tagList); + + evaluateTaggers(taggedSentence, tagging); + + } + + private void evaluateTaggers(String taggedSentence, Tagging<String> referenceTagging){ +// System.out.println("Checking tagged sentence:\n" + taggedSentence); + System.out.println(referenceTagging); + String extractedSentence = extractSentence(taggedSentence); +// System.out.println("Extracted sentence:\n" + extractedSentence); + for(PartOfSpeechTagger tagger : taggers){ + System.out.println("Testing " + tagger.getName()); + //get the tagging form the POS tagger + Tagging<String> tagging = tagger.getTagging(extractedSentence); + + String referenceTag; + String tag; + int errorCnt = 0; + for(int i = 0; i < referenceTagging.tags().size(); i++){ + referenceTag = referenceTagging.tags().get(i); + tag = tagging.tags().get(i); + if(!referenceTag.equalsIgnoreCase(tag)){ +// System.out.println(referenceTag + "--" + tag); + errorCnt++; + } + } + if(errorCnt > 0){ + System.out.println(tagging); + } + } + } + + public static void main(String[] args) { + POSTaggerEvaluation eval = new POSTaggerEvaluation(); + eval.run(new File(args[0])); + } + + +} Property changes on: trunk/components-ext/src/test/java/org/dllearner/algorithm/tbsl/POSTaggerEvaluation.java ___________________________________________________________________ Added: svn:mime-type + text/plain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |