Started to model the protograph for schema mapping.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@35 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-02-04 00:57:09 +00:00
parent 44ea417d0d
commit 863493950f
8 changed files with 169 additions and 0 deletions

View File

@ -0,0 +1,18 @@
package com.metaweb.gridworks.protograph;
import java.util.Properties;
import org.json.JSONException;
import org.json.JSONWriter;
public class AnonymousNode extends Node {
private static final long serialVersionUID = -6956243664838720646L;
@Override
public void write(JSONWriter writer, Properties options)
throws JSONException {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,16 @@
package com.metaweb.gridworks.protograph;
public class FreebaseProperty extends FreebaseTopic {
private static final long serialVersionUID = 7909539492956342421L;
final protected FreebaseType _expectedType;
public FreebaseProperty(String id, String name, FreebaseType expectedType) {
super(id, name);
_expectedType = expectedType;
}
public FreebaseType getExpectedType() {
return _expectedType;
}
}

View File

@ -0,0 +1,37 @@
package com.metaweb.gridworks.protograph;
import java.io.Serializable;
import java.util.Properties;
import org.json.JSONException;
import org.json.JSONWriter;
import com.metaweb.gridworks.Jsonizable;
public class FreebaseTopic implements Serializable, Jsonizable {
private static final long serialVersionUID = -3427885694129112432L;
final protected String _id;
final protected String _name;
public FreebaseTopic(String id, String name) {
_id = id;
_name = name;
}
public String getID() {
return _id;
}
public String getName() {
return _name;
}
@Override
public void write(JSONWriter writer, Properties options)
throws JSONException {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,10 @@
package com.metaweb.gridworks.protograph;
public class FreebaseType extends FreebaseTopic {
private static final long serialVersionUID = -3070300264980791404L;
public FreebaseType(String id, String name) {
super(id, name);
}
}

View File

@ -0,0 +1,37 @@
package com.metaweb.gridworks.protograph;
import java.io.Serializable;
import java.util.Properties;
import org.json.JSONException;
import org.json.JSONWriter;
import com.metaweb.gridworks.Jsonizable;
public class Link implements Serializable, Jsonizable {
private static final long serialVersionUID = 2908086768260322876L;
final protected FreebaseProperty _property;
final protected Node _target;
public Link(FreebaseProperty property, Node target) {
_property = property;
_target = target;
}
public FreebaseProperty getProperty() {
return _property;
}
public Node getTarget() {
return _target;
}
@Override
public void write(JSONWriter writer, Properties options)
throws JSONException {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,18 @@
package com.metaweb.gridworks.protograph;
import java.util.Properties;
import org.json.JSONException;
import org.json.JSONWriter;
public class NewNode extends Node {
private static final long serialVersionUID = 5820786756175547307L;
@Override
public void write(JSONWriter writer, Properties options)
throws JSONException {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,10 @@
package com.metaweb.gridworks.protograph;
import java.io.Serializable;
import com.metaweb.gridworks.Jsonizable;
abstract public class Node implements Serializable, Jsonizable {
private static final long serialVersionUID = 2892833010059212143L;
}

View File

@ -0,0 +1,23 @@
package com.metaweb.gridworks.protograph;
import java.util.Properties;
import org.json.JSONException;
import org.json.JSONWriter;
public class TopicNode extends Node {
private static final long serialVersionUID = 8418548867745587387L;
final protected FreebaseTopic _topic;
public TopicNode(FreebaseTopic topic) {
_topic = topic;
}
@Override
public void write(JSONWriter writer, Properties options)
throws JSONException {
// TODO Auto-generated method stub
}
}