Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/api/Atom.class and UBTft/classes/edu/lehigh/swat/bench/ubt/api/Atom.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/api/Query.class and UBTft/classes/edu/lehigh/swat/bench/ubt/api/Query.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/api/QueryResult.class and UBTft/classes/edu/lehigh/swat/bench/ubt/api/QueryResult.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/api/Repository.class and UBTft/classes/edu/lehigh/swat/bench/ubt/api/Repository.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/api/RepositoryFactory.class and UBTft/classes/edu/lehigh/swat/bench/ubt/api/RepositoryFactory.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/ConfigParser.class and UBTft/classes/edu/lehigh/swat/bench/ubt/ConfigParser.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/KbConfigParser.class and UBTft/classes/edu/lehigh/swat/bench/ubt/KbConfigParser.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/KbSpecification.class and UBTft/classes/edu/lehigh/swat/bench/ubt/KbSpecification.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/QueryConfigParser.class and UBTft/classes/edu/lehigh/swat/bench/ubt/QueryConfigParser.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/QuerySpecification.class and UBTft/classes/edu/lehigh/swat/bench/ubt/QuerySpecification.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/QueryTestResult.class and UBTft/classes/edu/lehigh/swat/bench/ubt/QueryTestResult.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/RepositoryCreator.class and UBTft/classes/edu/lehigh/swat/bench/ubt/RepositoryCreator.class sind verschieden. Binärdateien UBT/classes/edu/lehigh/swat/bench/ubt/Test.class and UBTft/classes/edu/lehigh/swat/bench/ubt/Test.class sind verschieden. diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/.classpath UBTft/.classpath --- UBT/.classpath 1970-01-01 01:00:00.000000000 +0100 +++ UBTft/.classpath 2009-01-05 12:35:51.000000000 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/config.query.example.rql UBTft/config.query.example.rql --- UBT/config.query.example.rql 1970-01-01 01:00:00.000000000 +0100 +++ UBTft/config.query.example.rql 2009-01-05 12:35:51.000000000 +0100 @@ -0,0 +1,117 @@ +# queries expressed in RQL +# [query ID] +# query + +[query1] +SELECT X +from + ub:GraduateStudent {X}. ub:takesCourse {Y} +where Y=http://www.Department0.University0.edu/GraduateCourse0 +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query2] +SELECT X, Y +from + ub:University {Y}, ub:Department {Z}, + ub:GraduateStudent {X}. ub:memberOf {Z}. ub:subOrganizationOf {Y}, + {X} ub:undergraduateDegreeFrom {Y} +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query3] +SELECT X +from + ub:Publication {X}. ub:publicationAuthor {Y} +where Y=http://www.Department0.University0.edu/AssistantProfessor0 +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query4] +SELECT X, Y1, Y2, Y3 +from + ub:Professor {X}. ub:worksFor {Y}, + {X} ub:name {Y1}, + {X} ub:emailAddress {Y2}, + {X} ub:telephone {Y3} +where + Y=http://www.Department0.University0.edu +using namespace + ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query5] +SELECT X +from + ub:Person {X}. ub:memberOf {Y} +where + Y=http://www.Department0.University0.edu +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query6] +SELECT X +from + ub:Student {X} +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query7] +SELECT X, Y +from + ub:Course {Y}, + ub:Student {X}. ub:takesCourse {Y}, + {Z} ub:teacherOf {Y} +where + Z=http://www.Department0.University0.edu/AssociateProfessor0 +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query8] +SELECT X, Z +from + ub:Department {Y}, + ub:Student {X}. ub:memberOf {Y}. ub:subOrganizationOf {U}, + {X} ub:emailAddress {Z} +where + U=http://www.University0.edu +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query9] +SELECT X, Y, Z +from + ub:Faculty {Y}, ub:Course {Z}, + ub:Student {X}. ub:advisor {Y}. ub:teacherOf {Z}, + {X} ub:takesCourse {Z} +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query10] +SELECT X +from + ub:Student {X}. ub:takesCourse {Y} +where + Y=http://www.Department0.University0.edu/GraduateCourse0 +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query11] +SELECT X +from + ub:ResearchGroup {X}. ub:subOrganizationOf {Y} +where Y=http://www.University0.edu +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query12] +SELECT X, Y +from + ub:Department {Y}, + ub:Chair {X}. ub:worksFor {Y}. ub:subOrganizationOf {U} +where U=http://www.University0.edu +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query13] +SELECT X +from + ub:Person {X}, + {Y} ub:hasAlumnus {X} +where + Y=http://www.University0.edu +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# + +[query14] +SELECT X +from + ub:UndergraduateStudent {X} +using namespace ub=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl# \ Kein Zeilenumbruch am Dateiende. diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/config.query.example.sparql UBTft/config.query.example.sparql --- UBT/config.query.example.sparql 1970-01-01 01:00:00.000000000 +0100 +++ UBTft/config.query.example.sparql 2009-01-05 12:35:51.000000000 +0100 @@ -0,0 +1,137 @@ +# queries expressed in SPARQL +# [query ID] +# query + +[query1] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:GraduateStudent . + ?X ub:takesCourse +} + +[query2] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y ?Z +WHERE { + ?X rdf:type ub:GraduateStudent . + ?Y rdf:type ub:University . + ?Z rdf:type ub:Department . + ?X ub:memberOf ?Z . + ?Z ub:subOrganizationOf ?Y . + ?X ub:undergraduateDegreeFrom ?Y +} + +[query3] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:Publication . + ?X ub:publicationAuthor +} + +[query4] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y1 ?Y2 ?Y3 +WHERE { + ?X rdf:type ub:Professor . + ?X ub:worksFor . + ?X ub:name ?Y1 . + ?X ub:emailAddress ?Y2 . + ?X ub:telephone ?Y3 +} + +[query5] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:Person . + ?X ub:memberOf +} + +[query7] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y +WHERE { + ?X rdf:type ub:Student . + ?Y rdf:type ub:Course . + ub:teacherOf ?Y . + ?X ub:takesCourse ?Y +} + +[query8] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y ?Z +WHERE { + ?X rdf:type ub:Student . + ?Y rdf:type ub:Department . + ?X ub:memberOf ?Y . + ?Y ub:subOrganizationOf . + ?X ub:emailAddress ?Z +} + +[query9] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y ?Z +WHERE { + ?X rdf:type ub:Student . + ?Y rdf:type ub:Faculty . + ?Z rdf:type ub:Course . + ?X ub:advisor ?Y . + ?X ub:takesCourse ?Z . + ?Y ub:teacherOf ?Z +} + +[query10] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:Student . + ?X ub:takesCourse +} + +[query11] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:ResearchGroup . + ?X ub:subOrganizationOf +} + +[query12] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y +WHERE { + ?X rdf:type ub:Chair . + ?Y rdf:type ub:Department . + ?X ub:worksFor ?Y . + ?Y ub:subOrganizationOf +} + +[query13] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:Person . + ub:hasAlumnus ?X +} + +[query14] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:UndergraduateStudent . +} diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/config.query.lubm-fulltext-ext.sparql.template UBTft/config.query.lubm-fulltext-ext.sparql.template --- UBT/config.query.lubm-fulltext-ext.sparql.template 1970-01-01 01:00:00.000000000 +0100 +++ UBTft/config.query.lubm-fulltext-ext.sparql.template 2009-01-05 12:35:51.000000000 +0100 @@ -0,0 +1,749 @@ +# queries expressed in SPARQL, using LuceneSail fulltext search syntax +# [query ID] +# query + + +# === BASIC IR QUERIES === + +[lubm-fulltext-1.1] +# All resources that match the keyword 'shades', a relatively infrequent term. There are only 4 results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, "shades")%% +} + +[lubm-fulltext-1.2] +# All resources that match the keyword 'engineer', a relatively infrequent term. There are 40 results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, "engineer")%% +} + +[lubm-fulltext-1.3] +# All resources that match the keyword 'summary', a more frequent term than 'engineer'. There are 400 results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, "summary")%% +} + +[lubm-fulltext-1.4] +# All resources that match the keyword 'figure', the most common term. There are 4,003 results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, "figure")%% +} + + + +[lubm-fulltext-2.1] +# All resources that match the keyword 'shades' in property 'ub:publicationText'. This query is more precise than lubm-fulltext-1.1, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "shades")%% +} + +[lubm-fulltext-2.2] +# All resources that match the keyword 'engineer' in property 'ub:publicationText'. This query is more precise than lubm-fulltext-1.2, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% +} + +[lubm-fulltext-2.3] +# All resources that match the keyword 'summary' in property 'ub:publicationText'. This query is more precise than lubm-fulltext-1.3, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "summary")%% +} + +[lubm-fulltext-2.4] +# All resources that match the keyword 'figure' in property 'ub:publicationText'. This query is more precise than lubm-fulltext-1.4, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% +} + + + +[lubm-fulltext-3.1] +# All resources that match the keywords 'shades' or 'network' in property 'ub:publicationText'. This query tests for OR boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "shades network")%% +} + +[lubm-fulltext-3.2] +# All resources that match the keywords 'engineer' or 'network' in property 'ub:publicationText'. This query tests for OR boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer network")%% +} + +[lubm-fulltext-3.3] +# All resources that match the keywords 'summary' or 'network' in property 'ub:publicationText'. This query tests for OR boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "summary network")%% +} + +[lubm-fulltext-3.4] +# All resources that match the keywords 'figure' or 'network' in property 'ub:publicationText'. This query tests for OR boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure network")%% +} + + + +[lubm-fulltext-4] +# All resources that match the phrase 'network engineer' in property 'ub:publicationText'. There are three such results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "\"network engineer\"")%% +} + + + +[lubm-fulltext-5.1] +# All resources that match the keyword 'stanford' in property 'ub:surname', a less frequent surname. There are 2 results in LUBMft(1). This query has a result set that is two orders of magnitude smaller in size then the result set of lubm-fulltext-3.1. This is to be compared with query lubm-fulltext-6.4. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:surname, "stanford")%% +} + +[lubm-fulltext-5.2] +# All resources that match the keyword 'smith' in property 'ub:surname', the most common surname. There are 95 results in LUBMft(1). This query is used to be compared with lubm-fulltext-6.3. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:surname, "smith")%% +} + +[lubm-fulltext-5.3] +# All resources that have the string literal "Stanford" as their surname. This query is equivalent to lubm-fulltext-5.1, except it refers to the exact string Literal. This allows for comparison of keyword and Literal lookup performance. +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X ub:surname "Stanford" . +} + +[lubm-fulltext-5.4] +# All resources that have the string literal "Smith" as their surname. This query is equivalent to lubm-fulltext-5.2, except it refers to the exact string Literal. This allows for comparison of keyword and Literal lookup performance. +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X ub:surname "Smith" . +} + + + +# === SEMANTIC IR QUERIES === + + + +[lubm-fulltext-6.1] +# All ub:Publications that match the keyword 'shades' in property 'ub:publicationText'. This query is even more precise than lubm-fulltext-2.1, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "shades")%% + ?X rdf:type ub:Publication . +} + +[lubm-fulltext-6.2] +# All ub:Publications that match the keyword 'engineer' in property 'ub:publicationText'. This query is even more precise than lubm-fulltext-2.2, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% + ?X rdf:type ub:Publication . +} + +[lubm-fulltext-6.3] +# All ub:Publications that match the keyword 'summary' in property 'ub:publicationText'. This query is even more precise than lubm-fulltext-2.3, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "summary")%% + ?X rdf:type ub:Publication . +} + +[lubm-fulltext-6.4] +# All ub:Publications that match the keyword 'figure' in property 'ub:publicationText'. This query is more precise than lubm-fulltext-2.4, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + ?X rdf:type ub:Publication . +} + + + +[lubm-fulltext-7.1] +# All ub:Publications and their title, that match the keyword 'shades' in property 'ub:publicationText'. Compared to lubm-fulltext-6.1, this query further extracts the titles of the publications from the triple store. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?title +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "shades")%% + ?X ub:name ?title . + ?X rdf:type ub:Publication . +} + +[lubm-fulltext-7.2] +# All ub:Publications and their title, that match the keyword 'engineer' in property 'ub:publicationText'. Compared to lubm-fulltext-6.2, this query further extracts the titles of the publications from the triple store. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?title +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% + ?X ub:name ?title . + ?X rdf:type ub:Publication . +} + +[lubm-fulltext-7.3] +# All ub:Publications and their title, that match the keyword 'summary' in property 'ub:publicationText'. Compared to lubm-fulltext-6.3, this query further extracts the titles of the publications from the triple store. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?title +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "summary")%% + ?X ub:name ?title . + ?X rdf:type ub:Publication . +} + +[lubm-fulltext-7.4] +# All ub:Publications and their title, that match the keyword 'figure' in property 'ub:publicationText'. Compared to lubm-fulltext-6.4, this query further extracts the titles of the publications from the triple store. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?title +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + ?X ub:name ?title . + ?X rdf:type ub:Publication . +} + + + +[lubm-fulltext-8.1] +# All ub:Publications, their title, and the paper's full professor's fullname, that match the keyword 'shades' in property 'ub:publicationText'. Compared to lubm-fulltext-8.1, this query further performs some triple index lookups to extract the full professor's fullnames. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?title ?fullname +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "shades")%% + ?X ub:name ?title . + ?X ub:publicationAuthor ?Y . + ?X rdf:type ub:Publication . + + ?Y ub:fullname ?fullname . + ?Y rdf:type ub:FullProfessor . +} + +[lubm-fulltext-8.2] +# All ub:Publications, their title, and the paper's full professor's fullname, that match the keyword 'engineer' in property 'ub:publicationText'. Compared to lubm-fulltext-8.2, this query further performs some triple index lookups to extract the full professor's fullnames. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?title ?fullname +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% + ?X ub:name ?title . + ?X ub:publicationAuthor ?Y . + ?X rdf:type ub:Publication . + + ?Y ub:fullname ?fullname . + ?Y rdf:type ub:FullProfessor . +} + +[lubm-fulltext-8.3] +# All ub:Publications, their title, and the paper's full professor's fullname, that match the keyword 'summary' in property 'ub:publicationText'. Compared to lubm-fulltext-8.3, this query further performs some triple index lookups to extract the full professor's fullnames. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?title ?fullname +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "summary")%% + ?X ub:name ?title . + ?X ub:publicationAuthor ?Y . + ?X rdf:type ub:Publication . + + ?Y ub:fullname ?fullname . + ?Y rdf:type ub:FullProfessor . +} + +[lubm-fulltext-8.4] +# All ub:Publications, their title, and the paper's full professor's fullname, that match the keyword 'figure' in property 'ub:publicationText'. Compared to lubm-fulltext-5.4, this query further performs some triple index lookups to extract the full professor's fullnames. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?title ?fullname +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + ?X ub:name ?title . + ?X ub:publicationAuthor ?Y . + ?X rdf:type ub:Publication . + + ?Y ub:fullname ?fullname . + ?Y rdf:type ub:FullProfessor . +} + + + +[lubm-fulltext-9.1.1] +# All resources that match the keyword 'shades' in ub:publicationText, and that are authored by someone matching 'stanford' in the ub:fullname property. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "shades")%% + + %%FULLTEXT_SEARCH(?Y, ub:fullname, "stanford")%% + + ?X ub:publicationAuthor ?Y . +} + +[lubm-fulltext-9.1.2] +# All resources that match the keyword 'engineer' in ub:publicationText, and that are authored by someone matching 'stanford' in the ub:fullname property. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% + + %%FULLTEXT_SEARCH(?Y, ub:fullname, "stanford")%% + + ?X ub:publicationAuthor ?Y . +} + +[lubm-fulltext-9.1.3] +# All resources that match the keyword 'summary' in ub:publicationText, and that are authored by someone matching 'stanford' in the ub:fullname property. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "summary")%% + + %%FULLTEXT_SEARCH(?Y, ub:fullname, "stanford")%% + + ?X ub:publicationAuthor ?Y . +} + +[lubm-fulltext-9.1.4] +# All resources that match the keyword 'figure' in ub:publicationText, and that are authored by someone matching 'stanford' in the ub:fullname property. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + + %%FULLTEXT_SEARCH(?Y, ub:fullname, "stanford")%% + + ?X ub:publicationAuthor ?Y . +} + + +[lubm-fulltext-9.2.1] +# All resources that match the keyword 'shade' in ub:publicationText, and that are authored by someone matching 'smith' in the ub:fullname property. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y +WHERE { + %%FULLTEXT_SEARCH(?Y, ub:fullname, "smith")%% + + %%FULLTEXT_SEARCH(?X, ub:publicationText, "shades")%% + + ?X ub:publicationAuthor ?Y . +} + +[lubm-fulltext-9.2.2] +# All resources that match the keyword 'engineer' in ub:publicationText, and that are authored by someone matching 'smith' in the ub:fullname property. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y +WHERE { + %%FULLTEXT_SEARCH(?Y, ub:fullname, "smith")%% + + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% + + ?X ub:publicationAuthor ?Y . +} + +[lubm-fulltext-9.2.3] +# All resources that match the keyword 'summary' in ub:publicationText, and that are authored by someone matching 'smith' in the ub:fullname property. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y +WHERE { + %%FULLTEXT_SEARCH(?Y, ub:fullname, "smith")%% + + %%FULLTEXT_SEARCH(?X, ub:publicationText, "summary")%% + + ?X ub:publicationAuthor ?Y . +} + +[lubm-fulltext-9.2.4] +# All resources that match the keyword 'figure' in ub:publicationText, and that are authored by someone matching 'smith' in the ub:fullname property. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + + %%FULLTEXT_SEARCH(?Y, ub:fullname, "smith")%% + + ?X ub:publicationAuthor ?Y . +} + + + +[lubm-fulltext-10.1] +# All resources that match the keyword 'figure' in ub:publicationText, and that are authored by a full professor who also authored a resource matching 'shades' in ub:publicationText. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y ?Z +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + + %%FULLTEXT_SEARCH(?Y, ub:publicationText, "shades")%% + + ?X ub:publicationAuthor ?Z . + ?Y ub:publicationAuthor ?Z . + ?Z rdf:type ub:FullProfessor . +} + +[lubm-fulltext-10.2] +# All resources that match the keyword 'figure' in ub:publicationText, and that are authored by a full professor who also authored a resource matching 'engineer' in ub:publicationText. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y ?Z +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + + %%FULLTEXT_SEARCH(?Y, ub:publicationText, "engineer")%% + + ?X ub:publicationAuthor ?Z . + ?Y ub:publicationAuthor ?Z . + ?Z rdf:type ub:FullProfessor . +} + +[lubm-fulltext-10.3] +# All resources that match the keyword 'figure' in ub:publicationText, and that are authored by a full professor who also authored a resource matching 'summary' in ub:publicationText. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y ?Z +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + + %%FULLTEXT_SEARCH(?Y, ub:publicationText, "summary")%% + + ?X ub:publicationAuthor ?Z . + ?Y ub:publicationAuthor ?Z . + ?Z rdf:type ub:FullProfessor . +} + +[lubm-fulltext-10.4] +# All resources that match the keyword 'figure' in ub:publicationText, and that are authored by a full professor who also authored a resource matching 'network' in ub:publicationText. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. Keyword 'network' has a cardinality of the same order of magnitude as 'figure', i.e. 1013 in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y ?Z +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + + %%FULLTEXT_SEARCH(?Y, ub:publicationText, "network")%% + + ?X ub:publicationAuthor ?Z . + ?Y ub:publicationAuthor ?Z . + ?Z rdf:type ub:FullProfessor . +} + + + +[lubm-fulltext-11.1] +# All resources that match the keyword 'figure' in ub:publicationText, and that are authored by a full professor matching 'stanford' in ub:fullname, who also authored a resource matching 'engineer' in ub:publicationText. This further introduces one more keyword search into the query. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y ?Z +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + + %%FULLTEXT_SEARCH(?Y, ub:publicationText, "engineer")%% + + %%FULLTEXT_SEARCH(?Z, ub:fullname, "stanford")%% + + ?X ub:publicationAuthor ?Z . + ?Y ub:publicationAuthor ?Z . + ?Z rdf:type ub:FullProfessor . +} + +[lubm-fulltext-11.2] +# All resources that match the keyword 'figure' in ub:publicationText, and that are authored by a full professor matching 'smith' in ub:fullname, who also authored a resource matching 'engineer' in ub:publicationText. This further introduces one more keyword search into the query. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y ?Z +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure")%% + + %%FULLTEXT_SEARCH(?Y, ub:publicationText, "engineer")%% + + %%FULLTEXT_SEARCH(?Z, ub:fullname, "smith")%% + + ?X ub:publicationAuthor ?Z . + ?Y ub:publicationAuthor ?Z . + ?Z rdf:type ub:FullProfessor . +} + + + +# === ADVANCED IR QUERIES === + + + +[lubm-fulltext-12.1] +# All resources that match the keywords 'shades' and 'network' in property 'ub:publicationText'. This query tests for AND boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "+shades +network")%% +} + +[lubm-fulltext-12.2] +# All resources that match the keywords 'engineer' and 'network' in property 'ub:publicationText'. This query tests for AND boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "+engineer +network")%% +} + +[lubm-fulltext-12.3] +# All resources that match the keywords 'summary' and 'network' in property 'ub:publicationText'. This query tests for AND boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "+summary +network")%% +} + +[lubm-fulltext-12.4] +# All resources that match the keywords 'figure' and 'network' in property 'ub:publicationText'. This query tests for AND boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "+figure +network")%% +} + + + +[lubm-fulltext-13.1] +# All resources that match the keywords 'network' but not 'shades' in property 'ub:publicationText'. This query tests for AND NOT boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "-shades +network")%% +} + +[lubm-fulltext-13.2] +# All resources that match the keywords 'network' but not 'engineer' in property 'ub:publicationText'. This query tests for AND NOT boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "-engineer +network")%% +} + +[lubm-fulltext-13.3] +# All resources that match the keywords 'network' but not 'summary' in property 'ub:publicationText'. This query tests for AND NOT boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "-summary +network")%% +} + +[lubm-fulltext-13.4] +# All resources that match the keywords 'network' but not 'figure' in property 'ub:publicationText'. This query tests for AND NOT boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "-figure +network")%% +} + + + +[lubm-fulltext-14] +# All resources that contains the keywords 'network' and 'engineer' in property 'ub:publicationText', where both keywords must occur in a distance of at most 10 words. There are 14 such results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "\"network engineer\"~10")%% +} + + + +[lubm-fulltext-15] +# All resources that match the wildcard query 'engineer*' in property 'ub:publicationText'. The query matches, 'engineer', 'engineering', and 'engineers'. There are 939 results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer*")%% +} + + + +[lubm-fulltext-16] +# All resources that match the wildcard query 'engineer?' in property 'ub:publicationText'. The query matches 'engineers', but not 'engineer'. There are 32 results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer?")%% +} + + + +[lubm-fulltext-17] +# All resources that match a keywords that is 80% similar to 'engineer'. Where 'engineer' has 40 results, this query has 71 in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer~0.8")%% +} + + + +[lubm-fulltext-18] +# All resources that match the keyword 'engineer' in property 'ub:publicationText'. This query further requests the score of each matching resource to be returned. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?score +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer", ?score)%% +} + + + +[lubm-fulltext-19] +# All resources that match the keyword 'engineer' in property 'ub:publicationText'. This query further requests a snippet of the matching literal of each matching resource to be returned. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?snippet +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer", ?snippet)%% +} + + + +[lubm-fulltext-20] +# All resources that match the keyword 'figure' in property 'ub:publicationText', but only 10 resources with the highest score. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?score +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure", ?score, 10)%% +} + +[lubm-fulltext-21] +# All resources that match the keyword 'figure' in property 'ub:publicationText', but only the resources with score higher than 0.75. Though the keyword has 4003 matches in LUBMft(1), only 8 have a higher score (lucene) than 0.75. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?score +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "figure", ?score, 0.75)%% +} diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/config.query.lubm-fulltext.sparql.template UBTft/config.query.lubm-fulltext.sparql.template --- UBT/config.query.lubm-fulltext.sparql.template 1970-01-01 01:00:00.000000000 +0100 +++ UBTft/config.query.lubm-fulltext.sparql.template 2009-01-05 12:35:51.000000000 +0100 @@ -0,0 +1,318 @@ +# queries expressed in SPARQL, using LuceneSail fulltext search syntax +# [query ID] +# query + + +# === BASIC IR QUERIES === + +[lubm-fulltext-1.1] +# All resources that match the keyword 'engineer', a relatively infrequent term. There are 40 results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, "engineer")%% +} + +[lubm-fulltext-1.2] +# All resources that match the keyword 'network', a very frequent term. There are 1,013 results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, "network")%% +} + + + +[lubm-fulltext-2.1] +# All resources that match the keyword 'engineer' in property 'ub:publicationText'. This query is more precise than lubm-fulltext-1.1, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% +} + +[lubm-fulltext-2.2] +# All resources that match the keyword 'network' in property 'ub:publicationText'. This query is more precise than lubm-fulltext-1.2, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "network")%% +} + + + +[lubm-fulltext-3] +# All resources that match the keywords 'engineer' or 'network' in property 'ub:publicationText'. This query tests for OR boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer network")%% +} + + + +[lubm-fulltext-4] +# All resources that match the phrase 'network engineer' in property 'ub:publicationText'. There are three such results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "\"network engineer\"")%% +} + + + +[lubm-fulltext-5.1] +# All resources that match the keyword 'smith' in property 'ub:surname', the most common surname. There are 95 results in LUBMft(1). This query is used to be compared with lubm-fulltext-5.2. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:surname, "smith")%% +} + +[lubm-fulltext-5.2] +# All resources that have the string literal "Smith" as their surname. This query is equivalent to lubm-fulltext-5.1, except it refers to the exact string Literal. This allows for comparison of keyword and Literal lookup performance. +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X ub:surname "Smith" . +} + + + +# === SEMANTIC IR QUERIES === + + + +[lubm-fulltext-6] +# All ub:Publications that match the keyword 'engineer' in property 'ub:publicationText'. This query is even more precise than lubm-fulltext-2.2, but the result set is identical. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% + ?X rdf:type ub:Publication . +} + + + +[lubm-fulltext-7] +# All ub:Publications and their title, that match the keyword 'engineer' in property 'ub:publicationText'. Compared to lubm-fulltext-6, this query further extracts the titles of the publications from the triple store. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?title +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% + ?X ub:name ?title . + ?X rdf:type ub:Publication . +} + + + +[lubm-fulltext-8] +# All ub:Publications, their title, and the paper's full professor's fullname, that match the keyword 'engineer' in property 'ub:publicationText'. Compared to lubm-fulltext-7, this query further performs some triple index lookups to extract the full professor's fullnames. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?title ?fullname +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% + ?X ub:name ?title . + ?X ub:publicationAuthor ?Y . + ?X rdf:type ub:Publication . + + ?Y ub:fullname ?fullname . + ?Y rdf:type ub:FullProfessor . +} + + + +[lubm-fulltext-9] +# All resources that match the keyword 'engineer' in ub:publicationText, and that are authored by someone matching 'smith' in the ub:fullname property. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y +WHERE { + %%FULLTEXT_SEARCH(?Y, ub:fullname, "smith")%% + + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer")%% + + ?X ub:publicationAuthor ?Y . +} + + + +[lubm-fulltext-10] +# All resources that match the keyword 'network' in ub:publicationText, and that are authored by a full professor who also authored a resource matching 'engineer' in ub:publicationText. This combines two keyword queries in one structured query. Connecting the two result sets of the keyword searches requires lookups of the semantic path between these resources. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?Y ?Z +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "network")%% + + %%FULLTEXT_SEARCH(?Y, ub:publicationText, "engineer")%% + + ?X ub:publicationAuthor ?Z . + ?Y ub:publicationAuthor ?Z . + ?Z rdf:type ub:FullProfessor . +} + + + +[lubm-fulltext-11] +# All resources that match the keyword 'network' in ub:publicationText, and that are authored by a full professor matching 'smith' in ub:fullname, who also authored a resource matching 'engineer' in ub:publicationText. This further introduces one more keyword search into the query. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT DISTINCT ?Z +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "network")%% + + %%FULLTEXT_SEARCH(?Y, ub:publicationText, "engineer")%% + + %%FULLTEXT_SEARCH(?Z, ub:fullname, "smith")%% + + ?X ub:publicationAuthor ?Z . + ?Y ub:publicationAuthor ?Z . + ?Z rdf:type ub:FullProfessor . +} + + + +# === ADVANCED IR QUERIES === + + + +[lubm-fulltext-12] +# All resources that match the keywords 'engineer' and 'network' in property 'ub:publicationText'. This query tests for AND boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "+engineer +network")%% +} + + + +[lubm-fulltext-13] +# All resources that match the keywords 'network' but not 'engineer' in property 'ub:publicationText'. This query tests for AND NOT boolean queries. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "-engineer +network")%% +} + + + +[lubm-fulltext-14] +# All resources that contains the keywords 'network' and 'engineer' in property 'ub:publicationText', where both keywords must occur in a distance of at most 10 words. There are 14 such results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "\"network engineer\"~10")%% +} + + + +[lubm-fulltext-15] +# All resources that match the wildcard query 'engineer*' in property 'ub:publicationText'. The query matches, 'engineer', 'engineering', and 'engineers'. There are 939 results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer*")%% +} + + + +[lubm-fulltext-16] +# All resources that match the wildcard query 'engineer?' in property 'ub:publicationText'. The query matches 'engineers', but not 'engineer'. There are 32 results in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer?")%% +} + + + +[lubm-fulltext-17] +# All resources that match a keywords that is 80% similar to 'engineer'. Where 'engineer' has 40 results, this query has 71 in LUBMft(1). +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer~0.8")%% +} + + + +[lubm-fulltext-18] +# All resources that match the keyword 'engineer' in property 'ub:publicationText'. This query further requests the score of each matching resource to be returned. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?score +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer", ?score)%% +} + + + +[lubm-fulltext-19] +# All resources that match the keyword 'engineer' in property 'ub:publicationText'. This query further requests a snippet of the matching literal of each matching resource to be returned. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?snippet +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "engineer", ?snippet)%% +} + + + +[lubm-fulltext-20] +# All resources that match the keyword 'network' in property 'ub:publicationText', but only 10 resources with the highest score. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?score +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "network", ?score, 10)%% +} + +[lubm-fulltext-21] +# All resources that match the keyword 'network' in property 'ub:publicationText', but only the resources with score higher than 0.75. Though the keyword has 1013 matches in LUBMft(1), only 43 have a higher score (lucene) than 0.75. +PREFIX rdf: +PREFIX ub: +%%FULLTEXT_SEARCH_PREFIX%% +SELECT ?X ?score +WHERE { + %%FULLTEXT_SEARCH(?X, ub:publicationText, "network", ?score, 0.75)%% +} diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/config.query.lubm-joins.sparql UBTft/config.query.lubm-joins.sparql --- UBT/config.query.lubm-joins.sparql 1970-01-01 01:00:00.000000000 +0100 +++ UBTft/config.query.lubm-joins.sparql 2009-01-05 12:35:51.000000000 +0100 @@ -0,0 +1,30 @@ +# queries expressed in SPARQL +# [query ID] +# query + +[lubm-joins-1.1] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X ub:fullname "John Smith" . +} + +[lubm-joins-1.2] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X ub:firstname "John" . + ?X ub:surname "Smith" . +} + +[lubm-joins-1.3] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X ub:firstname "John" . + ?X ub:surname "Smith" . + ?X ub:fullname "John Smith" . +} diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/config.query.lubm.sparql UBTft/config.query.lubm.sparql --- UBT/config.query.lubm.sparql 1970-01-01 01:00:00.000000000 +0100 +++ UBTft/config.query.lubm.sparql 2009-01-05 12:35:51.000000000 +0100 @@ -0,0 +1,137 @@ +# queries expressed in SPARQL +# [query ID] +# query + +[lubm1] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:GraduateStudent . + ?X ub:takesCourse +} + +[lubm2] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y ?Z +WHERE { + ?X rdf:type ub:GraduateStudent . + ?Y rdf:type ub:University . + ?Z rdf:type ub:Department . + ?X ub:memberOf ?Z . + ?Z ub:subOrganizationOf ?Y . + ?X ub:undergraduateDegreeFrom ?Y +} + +[lubm3] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:Publication . + ?X ub:publicationAuthor +} + +[lubm4] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y1 ?Y2 ?Y3 +WHERE { + ?X rdf:type ub:Professor . + ?X ub:worksFor . + ?X ub:name ?Y1 . + ?X ub:emailAddress ?Y2 . + ?X ub:telephone ?Y3 +} + +[lubm5] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:Person . + ?X ub:memberOf +} + +[lubm7] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y +WHERE { + ?X rdf:type ub:Student . + ?Y rdf:type ub:Course . + ub:teacherOf ?Y . + ?X ub:takesCourse ?Y +} + +[lubm8] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y ?Z +WHERE { + ?X rdf:type ub:Student . + ?Y rdf:type ub:Department . + ?X ub:memberOf ?Y . + ?Y ub:subOrganizationOf . + ?X ub:emailAddress ?Z +} + +[lubm9] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y ?Z +WHERE { + ?X rdf:type ub:Student . + ?Y rdf:type ub:Faculty . + ?Z rdf:type ub:Course . + ?X ub:advisor ?Y . + ?X ub:takesCourse ?Z . + ?Y ub:teacherOf ?Z +} + +[lubm10] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:Student . + ?X ub:takesCourse +} + +[lubm11] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:ResearchGroup . + ?X ub:subOrganizationOf +} + +[lubm12] +PREFIX rdf: +PREFIX ub: +SELECT ?X ?Y +WHERE { + ?X rdf:type ub:Chair . + ?Y rdf:type ub:Department . + ?X ub:worksFor ?Y . + ?Y ub:subOrganizationOf +} + +[lubm13] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:Person . + ub:hasAlumnus ?X +} + +[lubm14] +PREFIX rdf: +PREFIX ub: +SELECT ?X +WHERE { + ?X rdf:type ub:UndergraduateStudent . +} diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/flush-fs-cache.sh UBTft/flush-fs-cache.sh --- UBT/flush-fs-cache.sh 1970-01-01 01:00:00.000000000 +0100 +++ UBTft/flush-fs-cache.sh 2009-01-05 12:35:51.000000000 +0100 @@ -0,0 +1,2 @@ +#!/bin/sh +echo 3 > /proc/sys/vm/drop_caches diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/.project UBTft/.project --- UBT/.project 1970-01-01 01:00:00.000000000 +0100 +++ UBTft/.project 2009-01-05 12:35:51.000000000 +0100 @@ -0,0 +1,17 @@ + + + UBT + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/src/edu/lehigh/swat/bench/ubt/QueryTestResult.java UBTft/src/edu/lehigh/swat/bench/ubt/QueryTestResult.java --- UBT/src/edu/lehigh/swat/bench/ubt/QueryTestResult.java 2009-01-05 12:36:33.000000000 +0100 +++ UBTft/src/edu/lehigh/swat/bench/ubt/QueryTestResult.java 2009-01-05 12:35:51.000000000 +0100 @@ -19,9 +19,12 @@ package edu.lehigh.swat.bench.ubt; +import java.util.ArrayList; +import java.util.List; + public class QueryTestResult { /** query response time (ms) */ - public long duration_; + public List duration_ = new ArrayList(); /** number of answers */ - public long resultNum_; -} \ Kein Zeilenumbruch am Dateiende. + public List resultNum_ = new ArrayList(); +} diff -ruN --exclude=.svn --exclude='querylog*' --exclude='*.pl' --exclude='*.jar*' UBT/src/edu/lehigh/swat/bench/ubt/Test.java UBTft/src/edu/lehigh/swat/bench/ubt/Test.java --- UBT/src/edu/lehigh/swat/bench/ubt/Test.java 2009-01-05 12:36:33.000000000 +0100 +++ UBTft/src/edu/lehigh/swat/bench/ubt/Test.java 2009-01-05 12:35:51.000000000 +0100 @@ -26,14 +26,20 @@ public class Test extends RepositoryCreator { /** execution times of each query */ - public static final int QUERY_TIME = 10; + public static final int QUERY_TIME = 6; /** name of file to hold the query test result */ private static final String QUERY_TEST_RESULT_FILE = "result.txt"; + /** command to flush system fs caches */ + private static final String FLUSH_FS_CACHE_COMMAND = "sudo /usr/sbin/flush-fs-cache.sh"; + /** maximum allowed duration for a query, queries exceeding this limit are not executed anymore */ + private static final Integer MAX_DURATION = 1000000; /** list of target systems */ private Vector kbList_; //KbSpec /** list of test queries */ private Vector queryList_; //QuerySpec + /** list of test query ids that shall not be executed anymore */ + private List prunedQueries_ = new ArrayList(); /** result holder of query test */ private QueryTestResult[][] queryTestResults_; /** Output stream for query test results. The file is created simply to ease the @@ -220,7 +226,6 @@ private void testQueryOneKb(int index) { QuerySpecification query; Date startTime, endTime; - long duration = 0l, sum; KbSpecification kb; long resultNum = 0; QueryResult result; @@ -235,6 +240,12 @@ //set ontology repository_.setOntology(kb.ontology_); + + //wait some + try { + Thread.sleep(3000); + } catch (InterruptedException e) { + } System.out.println(); System.out.println("### Started testing " + kb.id_ + " ###"); @@ -242,43 +253,92 @@ //test each query on this repository for (int i = 0; i < queryList_.size(); i++) { + //flush system caches first + flushFSCache(); + //open repository if (!isMemory_) repository_.open(kb.dbFile_); - sum = 0l; query = (QuerySpecification)queryList_.get(i); System.out.println(); System.out.println("~~~" + query.id_ + "~~~"); + //issue the query for QUERY_TIME times - int j; - for (j = 0; j < QUERY_TIME; j++) { - startTime = new Date(); - result = repository_.issueQuery(query.query_); - if (result == null) { - repository_.close(); - System.err.println("Query error!"); - System.exit(-1); + queryTestResults_[index][i] = new QueryTestResult(); + for (int j = 0; j < QUERY_TIME; j++) { + long duration = 0l; + if(query.query_.getString().length() == 0) { + // this query is empty, so it is not supported by the store + duration = 0; + resultNum = -3; // marks it as not supported + } else if(prunedQueries_.contains(i)) { + // this query took too much time previously, so don't evaluate it again + duration = 0; + resultNum = -2; // marks it as pruned + } else { + startTime = new Date(); + result = repository_.issueQuery(query.query_); + if (result == null) { + // don't stop querying but note the error in the result + //repository_.close(); + System.err.println("Query error!"); + resultNum = -1; + duration = 0; + j = QUERY_TIME; + //System.exit(-1); + } else { + //traverse the result set. + resultNum = 0; + while (result.next() != false) resultNum++; + endTime = new Date(); + duration = endTime.getTime() - startTime.getTime(); + + // if this query took too long, + // or if the j-times we evaluated this query already exceeds the MAX_DURATION, + // we do not want to evaluate it again + if(duration > MAX_DURATION/2) { + prunedQueries_.add(i); + } + } } - //traverse the result set. - resultNum = 0; - while (result.next() != false) resultNum++; - endTime = new Date(); - duration = endTime.getTime() - startTime.getTime(); - sum += duration; System.out.println("\tDuration: " + duration + "\tResult#: " + resultNum); + queryTestResults_[index][i].duration_.add(duration); + queryTestResults_[index][i].resultNum_.add(resultNum); } //end of for j //close the repository if (!isMemory_) repository_.close(); - //record the result - queryTestResults_[index][i] = new QueryTestResult(); - queryTestResults_[index][i].duration_ = sum/j; - queryTestResults_[index][i].resultNum_ = resultNum; result = null; - queryTestResultFile_.println(sum/j); + for(Long duration : queryTestResults_[index][i].duration_) + queryTestResultFile_.println(duration); queryTestResultFile_.println(resultNum); queryTestResultFile_.println(); } //end of for i System.out.println("### Finished testing " + kb.id_ + " ###"); } + + /** + * Flushes system caches to avoid influences of previously executed queries on this system. + */ + private void flushFSCache() { + try { + Process flush = Runtime.getRuntime().exec(FLUSH_FS_CACHE_COMMAND); + if(flush.waitFor() != 0) { + System.err.println("Could not flush system filesystem caches, ignoring!"); + System.err.println("Subsequent queries now may influence each others performance!"); + } else { + //wait some + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + } + } + } catch (IOException e) { + System.err.println("could not run filesystem cache flush command '" + FLUSH_FS_CACHE_COMMAND + "':"); + e.printStackTrace(); + } catch (InterruptedException e) { + System.err.println("interruption while waiting for filesystem cache flush command '" + FLUSH_FS_CACHE_COMMAND + "' to terminate:"); + e.printStackTrace(); + } + } /** * Displays the loading test results. @@ -307,16 +367,24 @@ System.out.print("\t\t" + kb.id_); } System.out.println(); - System.out.println("\t\tTime/Result#"); + System.out.print("\t\tDuration"); + for (int i = 0; i < QUERY_TIME; i++) { + System.out.print("\t"); + } + System.out.println("Result#"); for (int j = 0; j < queryList_.size(); j++) { query = (QuerySpecification)queryList_.get(j); System.out.print(query.id_); for (int i = 0; i < kbList_.size(); i++) { kb = (KbSpecification)kbList_.get(i); result = queryTestResults_[i][j]; - System.out.print("\t\t" + result.duration_ + "/" + result.resultNum_); + System.out.print("\t\t"); + for(Long duration : result.duration_) + System.out.print(duration + "\t"); + for(Long results : result.resultNum_) + System.out.print(results + "\t"); } System.out.println(); } } -} \ Kein Zeilenumbruch am Dateiende. +}