Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
dkapoor committed Aug 8, 2014
2 parents ad4ce60 + 23e7745 commit 5173bed
Show file tree
Hide file tree
Showing 169 changed files with 4,889 additions and 3,561 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ Thumbs.db

*.sh


*.log
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,12 @@

public class ApplyHistoryFromR2RMLModelCommand extends WorksheetCommand {
private final File r2rmlModelFile;
private final String worksheetId;
private boolean override;
private static Logger logger = LoggerFactory.getLogger(ApplyHistoryFromR2RMLModelCommand.class);

protected ApplyHistoryFromR2RMLModelCommand(String id, File uploadedFile, String worksheetId, boolean override) {
super(id, worksheetId);
this.r2rmlModelFile = uploadedFile;
this.worksheetId = worksheetId;
this.override = override;
}

Expand Down Expand Up @@ -116,7 +114,8 @@ public UpdateContainer doIt(Workspace workspace) throws CommandException {
AlignmentManager alignMgr = AlignmentManager.Instance();
Alignment alignment = alignMgr.getAlignment(workspace.getId(), worksheetId);
if (override || alignment == null || alignment.GetTreeRoot() == null) {
alignMgr.removeWorkspaceAlignments(workspace.getId());
String alignmentId = alignMgr.constructAlignmentId(workspace.getId(), worksheetId);
alignMgr.removeAlignment(alignmentId);
alignMgr.getAlignmentOrCreateIt(workspace.getId(), worksheetId, workspace.getOntologyManager());
editor.deleteExistingTransformationCommands();
historyJson = editor.getHistoryJSON();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ private Resource addKR2RMLMappingResource(Worksheet worksheet, KR2RMLMapping map
Property.inputColumns);
String outputColumns = worksheet.getMetadataContainer().getWorksheetProperties().getPropertyValue(
Property.outputColumns);
String oldHistory = worksheet.getMetadataContainer().getWorksheetProperties().getPropertyValue(
Property.oldCommandHistory);
String graphLabel = worksheet.getMetadataContainer().getWorksheetProperties().getPropertyValue(
Property.graphLabel);
String baseURI = worksheet.getMetadataContainer().getWorksheetProperties().getPropertyValue(
Expand All @@ -104,7 +106,9 @@ private Resource addKR2RMLMappingResource(Worksheet worksheet, KR2RMLMapping map
if (graphLabel != null && !graphLabel.trim().isEmpty())
con.add(mappingRes, repoURIs.get(Uris.KM_HAS_MODELLABEL), f.createLiteral(graphLabel));
if (baseURI != null && !baseURI.trim().isEmpty())
con.add(mappingRes, repoURIs.get(Uris.KM_HAS_BASEURI), f.createLiteral(baseURI));
con.add(mappingRes, repoURIs.get(Uris.KM_HAS_BASEURI), f.createLiteral(baseURI));
if (oldHistory != null && !oldHistory.trim().isEmpty())
con.add(mappingRes, repoURIs.get(Uris.KM_HAS_OLDHISTORY), f.createLiteral(oldHistory));
addWorksheetProperties(worksheet, mappingRes);
addCompleteWorksheetHistory(mapping, mappingRes);
return mappingRes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.isi.karma.controller.command.Command;
import edu.isi.karma.controller.command.CommandException;
import edu.isi.karma.controller.command.CommandType;
import edu.isi.karma.controller.command.ICommand.CommandTag;
import edu.isi.karma.controller.command.WorksheetCommand;
import edu.isi.karma.controller.update.UpdateContainer;
import edu.isi.karma.controller.update.WorksheetUpdateFactory;
import edu.isi.karma.modeling.alignment.Alignment;
Expand All @@ -24,8 +25,8 @@
* @author dipsy
*
*/
public class AddNodeCommand extends Command {
private String worksheetId;
public class AddNodeCommand extends WorksheetCommand {

private String nodeUri;
private String nodeLabel;
private String alignmentId;
Expand All @@ -37,8 +38,7 @@ public class AddNodeCommand extends Command {
private DirectedWeightedMultigraph<Node, DefaultLink> oldGraph;

protected AddNodeCommand(String id, String worksheetId, String alignmentId, String uri, String label) {
super(id);
this.worksheetId = worksheetId;
super(id, worksheetId);
this.alignmentId = alignmentId;
this.nodeUri = uri;
this.nodeLabel = label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@
******************************************************************************/
package edu.isi.karma.controller.command.alignment;

import edu.isi.karma.controller.command.Command;
import java.util.Set;

import org.jgrapht.graph.DirectedWeightedMultigraph;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.isi.karma.controller.command.CommandException;
import edu.isi.karma.controller.command.CommandType;
import edu.isi.karma.controller.command.WorksheetCommand;
import edu.isi.karma.controller.update.AlignmentSVGVisualizationUpdate;
import edu.isi.karma.controller.update.ErrorUpdate;
import edu.isi.karma.controller.update.SemanticTypesUpdate;
Expand All @@ -32,19 +38,13 @@
import edu.isi.karma.modeling.alignment.LinkIdFactory;
import edu.isi.karma.rep.Worksheet;
import edu.isi.karma.rep.Workspace;
import edu.isi.karma.rep.alignment.LabeledLink;
import edu.isi.karma.rep.alignment.DefaultLink;
import edu.isi.karma.rep.alignment.LabeledLink;
import edu.isi.karma.rep.alignment.LinkStatus;
import edu.isi.karma.rep.alignment.Node;
import org.jgrapht.graph.DirectedWeightedMultigraph;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Set;

public class AddUserLinkToAlignmentCommand extends Command {
public class AddUserLinkToAlignmentCommand extends WorksheetCommand {

private final String worksheetId;
private final String edgeId;
private final String alignmentId;
private Alignment oldAlignment;
Expand All @@ -56,10 +56,9 @@ public class AddUserLinkToAlignmentCommand extends Command {

public AddUserLinkToAlignmentCommand(String id, String edgeId,
String alignmentId, String worksheetId) {
super(id);
super(id, worksheetId);
this.edgeId = edgeId;
this.alignmentId = alignmentId;
this.worksheetId = worksheetId;

addTag(CommandTag.Modeling);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@

package edu.isi.karma.controller.command.alignment;

import edu.isi.karma.controller.command.Command;
import org.jgrapht.graph.DirectedWeightedMultigraph;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.isi.karma.controller.command.CommandException;
import edu.isi.karma.controller.command.CommandType;
import edu.isi.karma.controller.command.WorksheetCommand;
import edu.isi.karma.controller.command.alignment.ChangeInternalNodeLinksCommandFactory.Arguments;
import edu.isi.karma.controller.update.AlignmentSVGVisualizationUpdate;
import edu.isi.karma.controller.update.SemanticTypesUpdate;
Expand All @@ -34,20 +41,14 @@
import edu.isi.karma.modeling.ontology.OntologyManager;
import edu.isi.karma.rep.Worksheet;
import edu.isi.karma.rep.Workspace;
import edu.isi.karma.rep.alignment.LabeledLink;
import edu.isi.karma.rep.alignment.Label;
import edu.isi.karma.rep.alignment.DefaultLink;
import edu.isi.karma.rep.alignment.Label;
import edu.isi.karma.rep.alignment.LabeledLink;
import edu.isi.karma.rep.alignment.LinkStatus;
import edu.isi.karma.rep.alignment.Node;
import org.jgrapht.graph.DirectedWeightedMultigraph;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ChangeInternalNodeLinksCommand extends Command {
private final String worksheetId;
public class ChangeInternalNodeLinksCommand extends WorksheetCommand {

private final String alignmentId;
private JSONArray initialEdges;
private JSONArray newEdges;
Expand All @@ -66,8 +67,7 @@ public enum JsonKeys {

public ChangeInternalNodeLinksCommand(String id, String worksheetId,
String alignmentId, JSONArray initialEdges, JSONArray newEdges) {
super(id);
this.worksheetId = worksheetId;
super(id, worksheetId);
this.alignmentId = alignmentId;
this.initialEdges = initialEdges;
this.newEdges = newEdges;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@

import org.json.JSONObject;

import edu.isi.karma.controller.command.Command;
import edu.isi.karma.controller.command.CommandException;
import edu.isi.karma.controller.command.CommandType;
import edu.isi.karma.controller.command.WorksheetCommand;
import edu.isi.karma.controller.update.AbstractUpdate;
import edu.isi.karma.controller.update.UpdateContainer;
import edu.isi.karma.modeling.alignment.Alignment;
import edu.isi.karma.modeling.alignment.AlignmentManager;
import edu.isi.karma.rep.Workspace;
import edu.isi.karma.view.VWorkspace;

public class CheckModelExistenceCommand extends Command {
private String worksheetId;
public class CheckModelExistenceCommand extends WorksheetCommand {

protected CheckModelExistenceCommand(String id, String worksheetId) {
super(id);
this.worksheetId = worksheetId;
super(id, worksheetId);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.isi.karma.controller.command.Command;
import edu.isi.karma.controller.command.CommandException;
import edu.isi.karma.controller.command.CommandType;
import edu.isi.karma.controller.command.WorksheetCommand;
import edu.isi.karma.controller.update.UpdateContainer;
import edu.isi.karma.controller.update.WorksheetUpdateFactory;
import edu.isi.karma.modeling.alignment.Alignment;
Expand All @@ -23,8 +23,8 @@
* @author dipsy
*
*/
public class DeleteNodeCommand extends Command {
private String worksheetId;
public class DeleteNodeCommand extends WorksheetCommand {

private String nodeId;
private String nodeLabel;
private String alignmentId;
Expand All @@ -36,8 +36,7 @@ public class DeleteNodeCommand extends Command {
private DirectedWeightedMultigraph<Node, DefaultLink> oldGraph;

protected DeleteNodeCommand(String id, String worksheetId, String alignmentId, String nodeId, String nodeLabel) {
super(id);
this.worksheetId = worksheetId;
super(id, worksheetId);
this.alignmentId = alignmentId;
this.nodeId = nodeId;
this.nodeLabel = nodeLabel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.isi.karma.controller.command.Command;
import edu.isi.karma.controller.command.CommandException;
import edu.isi.karma.controller.command.CommandType;
import edu.isi.karma.controller.command.WorksheetCommand;
import edu.isi.karma.controller.update.AbstractUpdate;
import edu.isi.karma.controller.update.ErrorUpdate;
import edu.isi.karma.controller.update.UpdateContainer;
Expand All @@ -28,36 +28,31 @@
import edu.isi.karma.rep.Workspace;
import edu.isi.karma.view.VWorkspace;

public class FetchR2RMLModelsListCommand extends Command{
public class FetchR2RMLModelsListCommand extends WorksheetCommand{

private String TripleStoreUrl;
private String context;
private String worksheetId;
private static Logger logger = LoggerFactory.getLogger(FetchR2RMLModelsListCommand.class);

public FetchR2RMLModelsListCommand(String id, String TripleStoreUrl, String context, String worksheetId) {
super(id);
super(id, worksheetId);
this.TripleStoreUrl = TripleStoreUrl;
this.context = context;
this.worksheetId = worksheetId;
}

@Override
public String getCommandName() {
// TODO Auto-generated method stub
return FetchR2RMLModelsListCommand.class.getSimpleName();
}

@Override
public String getTitle() {
// TODO Auto-generated method stub
return "Fetch R2RML from Triple Store";
}

@Override
public String getDescription() {
// TODO Auto-generated method stub
return null;
return "";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.isi.karma.controller.command.Command;
import edu.isi.karma.controller.command.CommandException;
import edu.isi.karma.controller.command.CommandType;
import edu.isi.karma.controller.command.WorksheetCommand;
import edu.isi.karma.controller.update.AbstractUpdate;
import edu.isi.karma.controller.update.UpdateContainer;
import edu.isi.karma.modeling.alignment.Alignment;
Expand All @@ -27,9 +27,8 @@
import edu.isi.karma.rep.alignment.NodeType;
import edu.isi.karma.view.VWorkspace;

public class GetClassesCommand extends Command {
public class GetClassesCommand extends WorksheetCommand {

final private String worksheetId;
final private INTERNAL_NODES_RANGE range;

public enum INTERNAL_NODES_RANGE {
Expand All @@ -45,8 +44,7 @@ private enum JsonKeys {
private static Logger logger = LoggerFactory.getLogger(GetClassesCommand.class.getSimpleName());

protected GetClassesCommand(String id, String worksheetId, INTERNAL_NODES_RANGE range, String propertyURI) {
super(id);
this.worksheetId = worksheetId;
super(id, worksheetId);
this.range = range;
this.propertyURI = propertyURI;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.isi.karma.controller.command.Command;
import edu.isi.karma.controller.command.CommandException;
import edu.isi.karma.controller.command.CommandType;
import edu.isi.karma.controller.command.WorksheetCommand;
import edu.isi.karma.controller.update.AbstractUpdate;
import edu.isi.karma.controller.update.UpdateContainer;
import edu.isi.karma.modeling.alignment.Alignment;
Expand All @@ -32,9 +32,8 @@
import edu.isi.karma.rep.alignment.ObjectPropertyLink;
import edu.isi.karma.view.VWorkspace;

public class GetPropertiesCommand extends Command {
public class GetPropertiesCommand extends WorksheetCommand {

final private String worksheetId;
final private INTERNAL_PROP_RANGE propertiesRange;

public enum INTERNAL_PROP_RANGE {
Expand All @@ -50,8 +49,7 @@ private enum JsonKeys {
private static Logger logger = LoggerFactory.getLogger(GetPropertiesCommand.class.getSimpleName());

protected GetPropertiesCommand(String id, String worksheetId, INTERNAL_PROP_RANGE propertiesRange, String classURI, String domainURI, String rangeURI) {
super(id);
this.worksheetId = worksheetId;
super(id, worksheetId);
this.propertiesRange = propertiesRange;
this.classURI = classURI;
this.domainURI = domainURI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.isi.karma.controller.command.Command;
import edu.isi.karma.controller.command.CommandException;
import edu.isi.karma.controller.command.CommandType;
import edu.isi.karma.controller.command.WorksheetCommand;
import edu.isi.karma.controller.update.AbstractUpdate;
import edu.isi.karma.controller.update.UpdateContainer;
import edu.isi.karma.modeling.alignment.Alignment;
Expand All @@ -22,15 +22,13 @@
import edu.isi.karma.rep.Workspace;
import edu.isi.karma.view.VWorkspace;

public class GetSemanticSuggestionsCommand extends Command {
public class GetSemanticSuggestionsCommand extends WorksheetCommand {
private final String hNodeId;
private final String worksheetId;
private static Logger logger = LoggerFactory.getLogger(GetSemanticSuggestionsCommand.class.getSimpleName());

protected GetSemanticSuggestionsCommand(String id, String worksheetId, String hNodeId) {
super(id);
super(id, worksheetId);
this.hNodeId = hNodeId;
this.worksheetId = worksheetId;
}

@Override
Expand Down
Loading

0 comments on commit 5173bed

Please sign in to comment.