Skip to content
This repository has been archived by the owner on Feb 21, 2018. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
kvndrsslr committed Mar 17, 2017
2 parents 6215a72 + 4bf19be commit 1de8dea
Show file tree
Hide file tree
Showing 48 changed files with 23,776 additions and 4,827 deletions.
433 changes: 243 additions & 190 deletions pom.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
package org.aksw.deer.helper.datastructure;

import com.hp.hpl.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Model;

/**
* @author sherif
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/aksw/deer/helper/kb/KBSampler.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import org.aksw.deer.workflow.specslearner.SimplePipeLineLearner;
import org.apache.log4j.Logger;

import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.Resource;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryExecutionFactory;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Resource;

/**
* @author sherif
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/aksw/deer/helper/vacabularies/DBpedia.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*/
package org.aksw.deer.helper.vacabularies;

import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.ResourceFactory;

public class DBpedia{
public static final String endPoint = "http://dbpedia.org/sparql";
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/aksw/deer/helper/vacabularies/SCMSANN.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*/
package org.aksw.deer.helper.vacabularies;

import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.ResourceFactory;

public class SCMSANN{
public static final String scmsAnnotation = "http://ns.aksw.org/scms/annotations/";
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/aksw/deer/helper/vacabularies/SPECS.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/
package org.aksw.deer.helper.vacabularies;

import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.ResourceFactory;

/**
* @author sherif
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/aksw/deer/io/Reader.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import org.apache.log4j.Logger;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.util.FileManager;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.util.FileManager;

/**
* @author sherif
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/aksw/deer/io/Writer.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import org.apache.log4j.Logger;

import com.hp.hpl.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Model;

/**
* @author sherif
Expand All @@ -25,4 +25,4 @@ public static void writeModel(Model model, String format, String outputFile) thr
model.write(fileWriter, format);
logger.info("Saving file done in " + (System.currentTimeMillis() - starTime) +"ms.");
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/org/aksw/deer/modules/DeerModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import org.aksw.deer.json.ParameterType;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Resource;

/**
* @author sherif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
import org.apache.log4j.Logger;

import com.google.common.collect.Sets;
import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryExecutionFactory;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.query.QuerySolution;
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.rdf.model.Statement;
import org.apache.jena.rdf.model.StmtIterator;
/**
* @author mofeed
* This class includes methods in order to load dataset in Model from file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@

import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.ResIterator;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.ResIterator;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.rdf.model.Statement;
import org.apache.jena.rdf.model.StmtIterator;

/**
* @author sherif
Expand Down Expand Up @@ -122,7 +122,7 @@ public static void main(String[] args) {
}

/* (non-Javadoc)
* @see org.aksw.geolift.modules.GeoLiftModule#process(com.hp.hpl.jena.rdf.model.Model, java.util.Map)
* @see org.aksw.geolift.modules.GeoLiftModule#process(org.apache.jena.rdf.model.Model, java.util.Map)
*/
@Override
public Model process(Model inputModel, Map<String, String> parameters) {
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/org/aksw/deer/modules/filter/FilterModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import org.aksw.deer.modules.DeerModule;
import org.apache.log4j.Logger;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.rdf.model.Statement;
import org.apache.jena.rdf.model.StmtIterator;

/**
* @author sherif
Expand Down Expand Up @@ -71,7 +71,7 @@ public static void main(String[] args) {
}

/* (non-Javadoc)
* @see org.aksw.geolift.modules.GeoLiftModule#process(com.hp.hpl.jena.rdf.model.Model, java.util.Map)
* @see org.aksw.geolift.modules.GeoLiftModule#process(org.apache.jena.rdf.model.Model, java.util.Map)
*/
@Override
public Model process(Model model, Map<String, String> parameters) {
Expand Down Expand Up @@ -115,7 +115,7 @@ public Model filterModel(){
// Resource o = ResourceFactory.createResource(str.split(">")[2].replaceAll("<", "").replaceAll(">", "").trim());
// accepted.add(s, p, o);
// }else if(str.split(">")[2].trim().startsWith("\"")){
// com.hp.hpl.jena.rdf.model.Literal o = ResourceFactory.createPlainLiteral(str.split(">")[2]);
// org.apache.jena.rdf.model.Literal o = ResourceFactory.createPlainLiteral(str.split(">")[2]);
// accepted.add(s, p, o);
// }
// }
Expand Down Expand Up @@ -166,7 +166,7 @@ public List<String> getNecessaryParameters() {
}

/* (non-Javadoc)
* @see org.aksw.geolift.modules.GeoLiftModule#selfConfig(com.hp.hpl.jena.rdf.model.Model, com.hp.hpl.jena.rdf.model.Model)
* @see org.aksw.geolift.modules.GeoLiftModule#selfConfig(org.apache.jena.rdf.model.Model, org.apache.jena.rdf.model.Model)
*/
@Override
public Map<String, String> selfConfig(Model source, Model target) {
Expand Down
49 changes: 25 additions & 24 deletions src/main/java/org/aksw/deer/modules/linking/LinkingModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,52 @@
import org.aksw.deer.helper.vacabularies.SPECS;
import org.aksw.deer.json.ParameterType;
import org.aksw.deer.modules.DeerModule;
import org.aksw.limes.core.io.config.reader.xml.XMLConfigurationReader;
import org.apache.log4j.Logger;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.Statement;
import org.apache.jena.rdf.model.StmtIterator;

import de.uni_leipzig.simba.controller.PPJoinController;
import org.aksw.limes.core.controller.Controller;

/**
* @author mofeed
*
*/
public class LinkingModule implements DeerModule{
private static final Logger logger = Logger.getLogger(LinkingModule.class.getName());

private static final String LINKS_PART = "linkspart";
private static final String LINKS_FILE = "linksfile";
private static final String SPEC_FILE = "specfile";

private static final String LINKS_PART_DESC = "Represents the position of the URI to be enriched in the links file";
private static final String LINKS_FILE_DESC = "file to save links resulted from the linking process";
private static final String SPEC_FILE_DESC = "The specification file used for linking process";


private String specFilePath;
private String linksFilePath;
private String linksPart;

/**
* @param model: the model of the dataset to be enriched
* @param parameters: list of parameters needed for the processing include:
* datasetFilePath,specFilePath,linksFilePath,linksPart
* @return model enriched with links generated from a linking tool
*/

public Model process(Model model, Map<String, String> parameters)
public Model process(Model model, Map<String, String> parameters)
{
logger.info("--------------- Linking Module ---------------");
//Copy parameters from Map into List
// String datasetSource = parameters.get("datasetSource");
// String datasetSource = parameters.get("datasetSource");

for(String key : parameters.keySet()){
if(key.equalsIgnoreCase(SPEC_FILE)){
specFilePath = parameters.get(SPEC_FILE);
Expand All @@ -67,14 +68,14 @@ public Model process(Model model, Map<String, String> parameters)
System.exit(1);
}
}

model = setPrefixes(model);
linkingProcess(specFilePath);
model= addLinksToModel(model, linksFilePath,linksPart);
return model;
}

public List<String> getParameters()
public List<String> getParameters()
{
List<String> parameters = new ArrayList<String>();
// parameters.add("datasetSource");
Expand All @@ -83,7 +84,7 @@ public List<String> getParameters()
parameters.add(LINKS_PART);
return parameters;
}

/* (non-Javadoc)
* @see org.aksw.geolift.modules.GeoLiftModule#getNecessaryParameters()
*/
Expand All @@ -99,7 +100,7 @@ public List<String> getNecessaryParameters() {
*/
private void linkingProcess(String specFilePath)
{
PPJoinController.run(specFilePath);
Controller.getMapping(new XMLConfigurationReader(specFilePath).read());
}
/**
* @param model: the model of the dataset to be enriched
Expand All @@ -115,7 +116,7 @@ private Model addLinksToModel(Model model,String linksFilePath, String linksPart
StmtIterator iter = linksModel.listStatements();

// print out the predicate, subject and object of each statement
while (iter.hasNext())
while (iter.hasNext())
{
Statement stmt = iter.nextStatement(); // get next statement
Resource subject = stmt.getSubject(); // get the subject
Expand All @@ -133,8 +134,8 @@ private Model addLinksToModel(Model model,String linksFilePath, String linksPart
resource = model.getResource(object.toString());
resource.addProperty(predicate, subject);
}
}
return model;
}
return model;
}

/**
Expand All @@ -143,7 +144,7 @@ private Model addLinksToModel(Model model,String linksFilePath, String linksPart
* This function reads the links generated by a linking tool into a model
*/
private Model getLinks(String linksFilePath)
{
{
Model model= ModelFactory.createDefaultModel();
model=org.aksw.deer.io.Reader.readModel(linksFilePath);
return model;
Expand Down Expand Up @@ -234,7 +235,7 @@ public static void main(String[] args) {
}

/* (non-Javadoc)
* @see org.aksw.geolift.modules.GeoLiftModule#selfConfig(com.hp.hpl.jena.rdf.model.Model, com.hp.hpl.jena.rdf.model.Model)
* @see org.aksw.geolift.modules.GeoLiftModule#selfConfig(org.apache.jena.rdf.model.Model, org.apache.jena.rdf.model.Model)
*/
@Override
public Map<String, String> selfConfig(Model source, Model target) {
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/org/aksw/deer/modules/nlp/LiteralPropertyRanker.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@

import org.apache.log4j.Logger;

import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.NodeIterator;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.util.FileManager;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryExecutionFactory;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.query.QuerySolution;
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.NodeIterator;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.util.FileManager;


/**
Expand Down
Loading

0 comments on commit 1de8dea

Please sign in to comment.