You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by rw...@apache.org on 2011/02/26 15:01:31 UTC
svn commit: r1074848 - in /incubator/stanbol/trunk/entityhub:
generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/
generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/site/
indexing/dbPedia/ indexing/dblp/src/main/j...
Author: rwesten
Date: Sat Feb 26 14:01:31 2011
New Revision: 1074848
URL: http://svn.apache.org/viewvc?rev=1074848&view=rev
Log:
Several small improvements/changes implemented during the Semantic Interaction Hackatron in Vienna
Changed the Component names for Dereferencers and Searchers from
"org.apache.stanbol.entityhub.site.<ImplClassName>"
to
"org.apache.stanbol.entityhub.dereferencer.<ImplClassName>"
"org.apache.stanbol.entityhub.searcher.<ImplClassName>"
This prepares a planed change to allow configuring the Dereferencer/Searcher for a ReferencedSIte only by using the simple Class name (instead of the full name). The initialisation of the Component within the ReferencedSite will than also look for "searcher.<ImplClassName>" and "dereferencer.<ImplClassName>" if no Component for the configured value can be instantiated by the available ComponentFactories.
Changed the name of the constant DEFAULT_MAPEED_ENTITY_STATE to DEFAULT_MAPPING_STATE
SolrYard: Changed all select requests from GET to POST after discovering some problems with the URL Encoding of special Characters like 'é' when using GET
Corrected a bug of the RdfIndexer The indexer collects <chunksize> representations in a local cache to index them all at once. The Bug caused Representations remaining in the cache when the indexing completed to be not indexed in the SolrYard.
dblp indexer: Added the option that allows to configure the indexer to use MultiYardLayout (see SolrYard documentation for details)
DBpedia indexer: Added a readme.txt that describes the basic steps needed
to use this indexer.
Removed an unused metatype.properties form the linkedData bundle
Added:
incubator/stanbol/trunk/entityhub/indexing/dbPedia/README.txt (with props)
Removed:
incubator/stanbol/trunk/entityhub/site/linkedData/src/main/resources/OSGI-INF/
Modified:
incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java
incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/site/ConfiguredSite.java
incubator/stanbol/trunk/entityhub/indexing/dblp/src/main/java/org/apache/stanbol/entityhub/indexing/dblp/cli/CommandLineRunner.java
incubator/stanbol/trunk/entityhub/indexing/genericRdf/src/main/java/org/apache/stanbol/entityhub/indexing/rdf/RdfIndexer.java
incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/CoolUriDereferencer.java
incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/LarqSearcher.java
incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlDereferencer.java
incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlSearcher.java
incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/VirtuosoSearcher.java
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java
Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java?rev=1074848&r1=1074847&r2=1074848&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java Sat Feb 26 14:01:31 2011
@@ -153,11 +153,11 @@ import org.slf4j.LoggerFactory;
name=""),
@PropertyOption(
value='%'+ConfiguredSite.DEREFERENCER_TYPE+".option.sparql",
- name="org.apache.stanbol.entityhub.site.SparqlDereferencer"),
+ name="org.apache.stanbol.entityhub.dereferencer.SparqlDereferencer"),
@PropertyOption(
value='%'+ConfiguredSite.DEREFERENCER_TYPE+".option.coolUri",
- name="org.apache.stanbol.entityhub.site.CoolUriDereferencer")
- },value="org.apache.stanbol.entityhub.site.SparqlDereferencer"),
+ name="org.apache.stanbol.entityhub.dereferencer.CoolUriDereferencer")
+ },value="org.apache.stanbol.entityhub.dereferencer.SparqlDereferencer"),
@Property(name=ConfiguredSite.QUERY_URI, value="http://dbpedia.org/sparql"), //the deri server has better performance
@Property(name=ConfiguredSite.SEARCHER_TYPE,
options={
@@ -166,14 +166,14 @@ import org.slf4j.LoggerFactory;
name=""),
@PropertyOption(
value='%'+ConfiguredSite.SEARCHER_TYPE+".option.sparql",
- name="org.apache.stanbol.entityhub.site.SparqlSearcher"),
+ name="org.apache.stanbol.entityhub.searcher.SparqlSearcher"),
@PropertyOption(
value='%'+ConfiguredSite.SEARCHER_TYPE+".option.sparql-virtuoso",
- name="org.apache.stanbol.entityhub.site.VirtuosoSearcher"),
+ name="org.apache.stanbol.entityhub.searcher.VirtuosoSearcher"),
@PropertyOption(
value='%'+ConfiguredSite.SEARCHER_TYPE+".option.sparql-larq",
- name="org.apache.stanbol.entityhub.site.LarqSearcher")
- },value="org.apache.stanbol.entityhub.site.VirtuosoSearcher"),
+ name="org.apache.stanbol.entityhub.searcher.LarqSearcher")
+ },value="org.apache.stanbol.entityhub.searcher.VirtuosoSearcher"),
@Property(name=ConfiguredSite.DEFAULT_SYMBOL_STATE,
options={
@PropertyOption( //seems, that name and value are exchanged ...
@@ -184,13 +184,13 @@ import org.slf4j.LoggerFactory;
name="active")
//the other states make no sense for new symbols
}, value="proposed"),
- @Property(name=ConfiguredSite.DEFAULT_MAPEED_ENTITY_STATE,
+ @Property(name=ConfiguredSite.DEFAULT_MAPPING_STATE,
options={
@PropertyOption(
- value='%'+ConfiguredSite.DEFAULT_MAPEED_ENTITY_STATE+".option.proposed",
+ value='%'+ConfiguredSite.DEFAULT_MAPPING_STATE+".option.proposed",
name="proposed"),
@PropertyOption(
- value='%'+ConfiguredSite.DEFAULT_MAPEED_ENTITY_STATE+".option.confirmed",
+ value='%'+ConfiguredSite.DEFAULT_MAPPING_STATE+".option.confirmed",
name="confirmed")
//the other states make no sense for new symbols
}, value="proposed"),
@@ -300,14 +300,14 @@ public class ReferencedSiteImpl implemen
@Override
public final EntityMapping.MappingState getDefaultMappedEntityState() {
- Object stateObject = properties.get(DEFAULT_MAPEED_ENTITY_STATE);
+ Object stateObject = properties.get(DEFAULT_MAPPING_STATE);
if(stateObject == null){
return EntityMapping.DEFAULT_MAPPING_STATE;
} else {
try {
return EntityMapping.MappingState.valueOf(stateObject.toString());
} catch (IllegalArgumentException e) {
- log.warn("Configuration "+DEFAULT_MAPEED_ENTITY_STATE+"="+stateObject+" dose not match any entry in the "+
+ log.warn("Configuration "+DEFAULT_MAPPING_STATE+"="+stateObject+" dose not match any entry in the "+
EntityMapping.MappingState.class+" Enumeration ( one of "+
Arrays.toString(EntityMapping.MappingState.values())+") " +
"-> return the default state "+EntityMapping.DEFAULT_MAPPING_STATE,e);
@@ -840,7 +840,7 @@ public class ReferencedSiteImpl implemen
createEntitySearcherComponent(factory);
}
} else {
- log.info(String.format("Ignore ServceEvent for ComponentFactory %s and state %s",
+ log.info(String.format("Ignore ServiceEvent for ComponentFactory %s and state %s",
eventComponentName,
event.getType()==ServiceEvent.MODIFIED?"MODIFIED":event.getType()==ServiceEvent.UNREGISTERING?"UNREGISTERING":"MODIFIED_ENDMATCH"));
}
Modified: incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/site/ConfiguredSite.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/site/ConfiguredSite.java?rev=1074848&r1=1074847&r2=1074848&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/site/ConfiguredSite.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/site/ConfiguredSite.java Sat Feb 26 14:01:31 2011
@@ -130,7 +130,7 @@ public interface ConfiguredSite {
* Key used for the configuration of the default {@link EntityMapping} state
* ({@link EntityMapping.MappingState} for a site
*/
- String DEFAULT_MAPEED_ENTITY_STATE = "org.apache.stanbol.entityhub.site.defaultMappedEntityState";
+ String DEFAULT_MAPPING_STATE = "org.apache.stanbol.entityhub.site.defaultMappedEntityState";
/**
* The initial state for mappings of entities managed by this site
* @return the default state for mappings to entities of this site
Added: incubator/stanbol/trunk/entityhub/indexing/dbPedia/README.txt
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/dbPedia/README.txt?rev=1074848&view=auto
==============================================================================
--- incubator/stanbol/trunk/entityhub/indexing/dbPedia/README.txt (added)
+++ incubator/stanbol/trunk/entityhub/indexing/dbPedia/README.txt Sat Feb 26 14:01:31 2011
@@ -0,0 +1,59 @@
+Indexer for the DBpedia dataset (see http://dbPedia.org/)
+
+This Tool creates a full cache for DBPedia based on the RDF Dump available via
+the download section of the dbpedia.org web page.
+
+Building:
+========
+If not yet build by the built process of the entityhub call
+ mvn install
+in this directory.
+
+To create the runable jar that contains all the dependencies call
+ mvn assembly:assembly
+
+If everything completes successfully, than there should be two jar files within
+the target directory.
+The one called
+ org.apache.stanbol.entityhub.indexing.dbPedia-0.1*-jar-with-dependencies.jar
+is the one to be used for indexing.
+
+Creating the index:
+==================
+
+(1) download the all the RDF files you need from the download section of the
+ dbpedia.org web page. Make sure you download all the files needed to have
+ all data available used by the configured mappings. All files need to be
+ in the directory parsed as second parameter to the tool.
+(2) To enable ranking for DBpedia resources you need to also to calculate the
+ incoming links for wikipedia sites using [1]. The generated file needs to
+ be parsed to the tool by using the -i parameter.
+ In case you use this feature also note the -ri parameter that can be used to
+ define the minimum required number of incomming links so that an entity gets
+ included in the index. (setting it to 2 will result in about 50% of all the
+ entities to be indexed)
+(3) The Indexer will need a SolrServer. So you need to prepare the Solr Index
+ to store the data.
+ A default configuration is provided within the "/solrConf" directory. This
+ can be used to configure a SorlServer or a new Core to an existing SolrServer.
+ You can parse the absolute path. In that case an EmbeddedSolrServer will be
+ used for indexing.
+ NOTE that the "/solrConf" directory only represents a Core and not a full
+ SolrServer configuration. You need to have a valid "solr.xml" in the parent
+ Directory of dbPedaia. See the Solr documentation for details how to
+ configure Cores.
+(4) call the tool with the -h option to print the help screen
+ java -jar ./target/org.apache.stanbol.entityhub.indexing.dblp-*-jar-with-dependencies.jar -h
+ The help screen should provide you with all the information needed for indexing
+
+Indexing will take a lot of time. Indexing time heavily depends on the IO
+operations/sec of the used hard disc.
+
+[1] https://gist.github.com/360315:
+ NOTE: There are two "head". The first restricts to 10e6 lines and the
+ second prints only the first ten lines. When calculating the page rank for
+ all entities one need to change this and pipe the results into a file.
+ Also NOTE that the Link to download the file with the incomming links
+ should be adopted to the version of the dumps you use for indexing.
+ e.g. http://downloads.dbpedia.org/3.6/en/page_links_en.nt.bz2 for
+ Version 3.6 of the dump
\ No newline at end of file
Propchange: incubator/stanbol/trunk/entityhub/indexing/dbPedia/README.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/stanbol/trunk/entityhub/indexing/dblp/src/main/java/org/apache/stanbol/entityhub/indexing/dblp/cli/CommandLineRunner.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/dblp/src/main/java/org/apache/stanbol/entityhub/indexing/dblp/cli/CommandLineRunner.java?rev=1074848&r1=1074847&r2=1074848&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/indexing/dblp/src/main/java/org/apache/stanbol/entityhub/indexing/dblp/cli/CommandLineRunner.java (original)
+++ incubator/stanbol/trunk/entityhub/indexing/dblp/src/main/java/org/apache/stanbol/entityhub/indexing/dblp/cli/CommandLineRunner.java Sat Feb 26 14:01:31 2011
@@ -140,6 +140,7 @@ public class CommandLineRunner {
options.addOption("i","incomming",true,"the file with the incomming links for Entities (id tab num, highest num needs to be the first line!)");
options.addOption("ri","requiredIncomming",true,"the minimum number of incomming lins for Entities to be indexed");
options.addOption("r","resume",true,"resume a previous canceled indexing session (usually used with -s)");
+ options.addOption("my","multiYardLayout",false,"If present the multi yard layout is used by the SolrYard");
}
private static final String footer;
static {
@@ -177,6 +178,9 @@ public class CommandLineRunner {
SolrYardConfig yardConfig = new SolrYardConfig(yardName, line.getArgs()[0]);
//use the signRank as default for document Boosts
yardConfig.setDocumentBoostFieldName(RdfResourceEnum.signRank.getUri());
+ if(line.hasOption("my")){
+ yardConfig.setMultiYardIndexLayout(true);
+ }
//increase the boost for fields that are usually used as labels
yardConfig.setFieldBoosts(fieldBoosts);
SolrYard yard = new SolrYard(yardConfig);
Modified: incubator/stanbol/trunk/entityhub/indexing/genericRdf/src/main/java/org/apache/stanbol/entityhub/indexing/rdf/RdfIndexer.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/genericRdf/src/main/java/org/apache/stanbol/entityhub/indexing/rdf/RdfIndexer.java?rev=1074848&r1=1074847&r2=1074848&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/indexing/genericRdf/src/main/java/org/apache/stanbol/entityhub/indexing/rdf/RdfIndexer.java (original)
+++ incubator/stanbol/trunk/entityhub/indexing/genericRdf/src/main/java/org/apache/stanbol/entityhub/indexing/rdf/RdfIndexer.java Sat Feb 26 14:01:31 2011
@@ -71,6 +71,7 @@ import com.hp.hpl.jena.rdf.model.Literal
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.RDFNode;
+import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.tdb.TDBFactory;
import com.hp.hpl.jena.tdb.TDBLoader;
import com.hp.hpl.jena.tdb.base.file.Location;
@@ -474,6 +475,10 @@ public class RdfIndexer {
} else {
indexResources();
}
+ if(!chunkCache.isEmpty()){
+ yard.store(chunkCache);
+ chunkCache.clear();
+ }
writeCacheBaseConfiguration();
}
/**
@@ -555,7 +560,10 @@ public class RdfIndexer {
String field = fieldNode.asResource().getURI();
RDFNode value = solution.get("value");
if(value.isURIResource()){
- source.addReference(field, value.asResource().getURI());
+ Resource r = value.asResource();
+ if(r.getURI() != null && !r.getURI().isEmpty()) {
+ source.addReference(field, value.asResource().getURI());
+ }
} else if(value.isLiteral()){
Literal literal = value.asLiteral();
if(literal.getDatatype() != null){
@@ -563,24 +571,45 @@ public class RdfIndexer {
try {
literalValue = literal.getValue();
} catch (DatatypeFormatException e) {
- log.warn(" Unable to convert "+literal.getLexicalForm()+" to "+literal.getDatatype()+"-> use lecicalForm");
- literalValue = literal.getLexicalForm();
+ String lexicalFrom = literal.getLexicalForm();
+ if(lexicalFrom != null && !lexicalFrom.isEmpty()){
+ log.warn(" Unable to convert "+literal.getLexicalForm()+" to "+literal.getDatatype()+"-> use lecicalForm");
+ literalValue = literal.getLexicalForm();
+ } else {
+ literalValue = null;
+ }
}
- if(literalValue instanceof BaseDatatype.TypedValue){
- source.add(field, ((BaseDatatype.TypedValue)literalValue).lexicalValue);
- } else if(literalValue instanceof XSDDateTime) {
- source.add(field, ((XSDDateTime)literalValue).asCalendar().getTime()); //Entityhub uses the time
- } else if(literalValue instanceof XSDDuration) {
- source.add(field, literalValue.toString());
- } else {
- source.add(field, literalValue);
+ if(literalValue != null){
+ if(literalValue instanceof BaseDatatype.TypedValue){
+ String lexicalValue = ((BaseDatatype.TypedValue)literalValue).lexicalValue;
+ if(lexicalValue != null && !lexicalValue.isEmpty()){
+ source.add(field, ((BaseDatatype.TypedValue)literalValue).lexicalValue);
+ }
+ } else if(literalValue instanceof XSDDateTime) {
+ source.add(field, ((XSDDateTime)literalValue).asCalendar().getTime()); //Entityhub uses the time
+ } else if(literalValue instanceof XSDDuration) {
+ String durationString = literalValue.toString();
+ if(durationString != null && !durationString.isEmpty()){
+ source.add(field, literalValue.toString());
+ }
+ } else {
+ if(literalValue instanceof String){
+ if(!((String)literalValue).isEmpty())
+ source.add(field, literalValue);
+ } else {
+ source.add(field, literalValue);
+ }
+ }
}
} else {
String lang = literal.getLanguage();
if(lang != null && lang.isEmpty()){
lang = null;
}
- source.addNaturalText(field, literal.getLexicalForm(),lang);
+ String lexicalFrom = literal.getLexicalForm();
+ if(lexicalFrom != null && !lexicalFrom.isEmpty()){
+ source.addNaturalText(field, literal.getLexicalForm(),lang);
+ }
}
}
}
Modified: incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/CoolUriDereferencer.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/CoolUriDereferencer.java?rev=1074848&r1=1074847&r2=1074848&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/CoolUriDereferencer.java (original)
+++ incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/CoolUriDereferencer.java Sat Feb 26 14:01:31 2011
@@ -38,8 +38,8 @@ import org.slf4j.LoggerFactory;
@Component(
- name="org.apache.stanbol.entityhub.site.CoolUriDereferencer",
- factory="org.apache.stanbol.entityhub.site.CoolUriDereferencerFactory",
+ name="org.apache.stanbol.entityhub.dereferencer.CoolUriDereferencer",
+ factory="org.apache.stanbol.entityhub.dereferencer.CoolUriDereferencerFactory",
policy=ConfigurationPolicy.REQUIRE, //the baseUri is required!
specVersion="1.1"
)
Modified: incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/LarqSearcher.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/LarqSearcher.java?rev=1074848&r1=1074847&r2=1074848&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/LarqSearcher.java (original)
+++ incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/LarqSearcher.java Sat Feb 26 14:01:31 2011
@@ -41,8 +41,8 @@ import org.slf4j.LoggerFactory;
@Component(
- name="org.apache.stanbol.entityhub.site.LarqSearcher",
- factory="org.apache.stanbol.entityhub.site.LarqSearcherFactory",
+ name="org.apache.stanbol.entityhub.searcher.LarqSearcher",
+ factory="org.apache.stanbol.entityhub.searcher.LarqSearcherFactory",
policy=ConfigurationPolicy.REQUIRE, //the queryUri and the SPARQL Endpoint are required
specVersion="1.1"
)
Modified: incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlDereferencer.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlDereferencer.java?rev=1074848&r1=1074847&r2=1074848&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlDereferencer.java (original)
+++ incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlDereferencer.java Sat Feb 26 14:01:31 2011
@@ -27,9 +27,11 @@ import org.apache.clerezza.rdf.core.seri
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.ConfigurationPolicy;
import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
import org.apache.stanbol.entityhub.core.site.AbstractEntityDereferencer;
import org.apache.stanbol.entityhub.model.clerezza.RdfValueFactory;
import org.apache.stanbol.entityhub.servicesapi.model.Representation;
+import org.apache.stanbol.entityhub.servicesapi.site.EntityDereferencer;
import org.slf4j.LoggerFactory;
@@ -39,22 +41,18 @@ import org.slf4j.LoggerFactory;
*
*/
@Component(
- name="org.apache.stanbol.entityhub.site.SparqlDereferencer",
- factory="org.apache.stanbol.entityhub.site.SparqlDereferencerFactory",
+ name="org.apache.stanbol.entityhub.dereferencer.SparqlDereferencer",
+ factory="org.apache.stanbol.entityhub.dereferencer.SparqlDereferencerFactory",
policy=ConfigurationPolicy.REQUIRE, //the baseUri and the SPARQL Endpoint are required
specVersion="1.1"
)
+@Service(value=EntityDereferencer.class)
public class SparqlDereferencer extends AbstractEntityDereferencer {
private final RdfValueFactory valueFactory = RdfValueFactory.getInstance();
public SparqlDereferencer(){
super(LoggerFactory.getLogger(SparqlDereferencer.class));
}
- /**
- * The key used to define the baseUri for instances of this Service
- * TODO: Maybe define this constants in the ReferenceManager Interface
- */
- public static final String SPARQL_ENDPOINT_URI = "org.apache.stanbol.entityhub.servicesapi.site.sparqlEndpointUri";
@Reference
protected Parser parser;
Modified: incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlSearcher.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlSearcher.java?rev=1074848&r1=1074847&r2=1074848&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlSearcher.java (original)
+++ incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlSearcher.java Sat Feb 26 14:01:31 2011
@@ -47,8 +47,8 @@ import org.slf4j.LoggerFactory;
@Component(
- name="org.apache.stanbol.entityhub.site.SparqlSearcher",
- factory="org.apache.stanbol.entityhub.site.SparqlSearcherFactory",
+ name="org.apache.stanbol.entityhub.searcher.SparqlSearcher",
+ factory="org.apache.stanbol.entityhub.searcher.SparqlSearcherFactory",
policy=ConfigurationPolicy.REQUIRE, //the queryUri and the SPARQL Endpoint are required
specVersion="1.1"
)
Modified: incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/VirtuosoSearcher.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/VirtuosoSearcher.java?rev=1074848&r1=1074847&r2=1074848&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/VirtuosoSearcher.java (original)
+++ incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/VirtuosoSearcher.java Sat Feb 26 14:01:31 2011
@@ -41,8 +41,8 @@ import org.slf4j.LoggerFactory;
@Component(
- name="org.apache.stanbol.entityhub.site.VirtuosoSearcher",
- factory="org.apache.stanbol.entityhub.site.VirtuosoSearcherFactory",
+ name="org.apache.stanbol.entityhub.searcher.VirtuosoSearcher",
+ factory="org.apache.stanbol.entityhub.searcher.VirtuosoSearcherFactory",
policy=ConfigurationPolicy.REQUIRE, //the queryUri and the SPARQL Endpoint are required
specVersion="1.1"
)
Modified: incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java?rev=1074848&r1=1074847&r2=1074848&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java (original)
+++ incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java Sat Feb 26 14:01:31 2011
@@ -40,6 +40,7 @@ import org.apache.felix.scr.annotations.
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.SolrRequest.METHOD;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.client.solrj.response.SolrPingResponse;
import org.apache.solr.common.SolrDocument;
@@ -343,7 +344,7 @@ public class SolrYard extends AbstractYa
}
QueryResponse respone;
try {
- respone = server.query(query);
+ respone = server.query(query,METHOD.POST);
} catch (SolrServerException e) {
throw new YardException("Error while performing Query on SolrServer!",e);
}
@@ -371,7 +372,7 @@ public class SolrYard extends AbstractYa
SolrQuery query = solrQueryFactoy.parseFieldQuery(parsedQuery,SELECT.ID);
QueryResponse respone;
try {
- respone = server.query(query);
+ respone = server.query(query,METHOD.POST);
} catch (SolrServerException e) {
throw new YardException("Error while performing query on the SolrServer",e);
}
@@ -797,7 +798,7 @@ public class SolrYard extends AbstractYa
//set the number of results to the number of parsed IDs.
solrQuery.setRows(num);
num = 0; //reset to 0
- QueryResponse queryResponse = server.query(solrQuery);
+ QueryResponse queryResponse = server.query(solrQuery,METHOD.POST);
if(resultDocs == null){
resultDocs = queryResponse.getResults();
} else {
@@ -827,7 +828,7 @@ public class SolrYard extends AbstractYa
String queryString = String.format("%s:%s",
fieldMapper.getDocumentIdField(),SolrUtil.escapeSolrSpecialChars(uri));
solrQuery.setQuery(queryString);
- QueryResponse queryResponse = server.query(solrQuery);
+ QueryResponse queryResponse = server.query(solrQuery,METHOD.POST);
if(queryResponse.getResults().isEmpty()){
return null;
} else {