http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/RdfCloudTripleStoreStatement.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/RdfCloudTripleStoreStatement.java b/common/rya.api/src/main/java/mvm/rya/api/RdfCloudTripleStoreStatement.java deleted file mode 100644 index 4a13c01..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/RdfCloudTripleStoreStatement.java +++ /dev/null @@ -1,72 +0,0 @@ -package mvm.rya.api; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.Resource; -import org.openrdf.model.Statement; -import org.openrdf.model.URI; -import org.openrdf.model.Value; -import org.openrdf.model.impl.ContextStatementImpl; -import org.openrdf.model.impl.StatementImpl; - -import java.util.ArrayList; -import java.util.Collection; - -public class RdfCloudTripleStoreStatement extends StatementImpl { - - private Resource[] contexts; //TODO: no blank nodes - - public RdfCloudTripleStoreStatement(Resource subject, URI predicate, Value object) { - super(subject, predicate, object); - } - - public RdfCloudTripleStoreStatement(Resource subject, URI predicate, Value object, - Resource... contexts) { - super(subject, predicate, object); - this.contexts = contexts; - } - - public Resource[] getContexts() { - return contexts; - } - - public Collection<Statement> getStatements() { - Collection<Statement> statements = new ArrayList<Statement>(); - - if (getContexts() != null && getContexts().length > 1) { - for (Resource contxt : getContexts()) { - statements.add(new ContextStatementImpl(getSubject(), - getPredicate(), getObject(), contxt)); - } - } else - statements.add(this); - - return statements; - } - - @Override - public Resource getContext() { - if (contexts == null || contexts.length == 0) - return null; - else return contexts[0]; - } -}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/RdfCloudTripleStoreUtils.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/RdfCloudTripleStoreUtils.java b/common/rya.api/src/main/java/mvm/rya/api/RdfCloudTripleStoreUtils.java deleted file mode 100644 index eeadb9b..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/RdfCloudTripleStoreUtils.java +++ /dev/null @@ -1,420 +0,0 @@ -package mvm.rya.api; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import mvm.rya.api.layout.TableLayoutStrategy; -import mvm.rya.api.layout.TablePrefixLayoutStrategy; -import org.openrdf.model.Literal; -import org.openrdf.model.URI; -import org.openrdf.model.Value; -import org.openrdf.model.ValueFactory; -import org.openrdf.model.impl.BNodeImpl; -import org.openrdf.model.impl.LiteralImpl; -import org.openrdf.model.impl.URIImpl; -import org.openrdf.model.impl.ValueFactoryImpl; - -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static mvm.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT; - -public class RdfCloudTripleStoreUtils { - - public static ValueFactory valueFactory = new ValueFactoryImpl(); - public static final Pattern literalPattern = Pattern.compile("^\"(.*?)\"((\\^\\^<(.+?)>)$|(@(.{2}))$)"); - -// public static byte[] writeValue(Value value) throws IOException { -// return RdfIO.writeValue(value); -//// if (value == null) -//// return new byte[]{}; -//// ByteArrayDataOutput dataOut = ByteStreams.newDataOutput(); -//// if (value instanceof URI) { -//// dataOut.writeByte(RdfCloudTripleStoreConstants.URI_MARKER); -//// writeString(((URI) value).toString(), dataOut); -//// } else if (value instanceof BNode) { -//// dataOut.writeByte(RdfCloudTripleStoreConstants.BNODE_MARKER); -//// writeString(((BNode) value).getID(), dataOut); -//// } else if (value instanceof Literal) { -//// Literal lit = (Literal) value; -//// -//// String label = lit.getLabel(); -//// String language = lit.getLanguage(); -//// URI datatype = lit.getDatatype(); -//// -//// if (datatype != null) { -//// dataOut.writeByte(RdfCloudTripleStoreConstants.DATATYPE_LITERAL_MARKER); -//// writeString(label, dataOut); -//// dataOut.write(writeValue(datatype)); -//// } else if (language != null) { -//// dataOut.writeByte(RdfCloudTripleStoreConstants.LANG_LITERAL_MARKER); -//// writeString(label, dataOut); -//// writeString(language, dataOut); -//// } else { -//// dataOut.writeByte(RdfCloudTripleStoreConstants.PLAIN_LITERAL_MARKER); -//// writeString(label, dataOut); -//// } -//// } else { -//// throw new IllegalArgumentException("unexpected value type: " -//// + value.getClass()); -//// } -//// return dataOut.toByteArray(); -// } - -// public static Value readValue(ByteArrayDataInput dataIn, ValueFactory vf) -// throws IOException, ClassCastException { -// return RdfIO.readValue(dataIn, vf, DELIM_BYTE); -//// int valueTypeMarker; -//// try { -//// valueTypeMarker = dataIn.readByte(); -//// } catch (Exception e) { -//// return null; -//// } -//// -//// Value ret = null; -//// if (valueTypeMarker == RdfCloudTripleStoreConstants.URI_MARKER) { -//// String uriString = readString(dataIn); -//// ret = vf.createURI(uriString); -//// } else if (valueTypeMarker == RdfCloudTripleStoreConstants.BNODE_MARKER) { -//// String bnodeID = readString(dataIn); -//// ret = vf.createBNode(bnodeID); -//// } else if (valueTypeMarker == RdfCloudTripleStoreConstants.PLAIN_LITERAL_MARKER) { -//// String label = readString(dataIn); -//// ret = vf.createLiteral(label); -//// } else if (valueTypeMarker == RdfCloudTripleStoreConstants.LANG_LITERAL_MARKER) { -//// String label = readString(dataIn); -//// String language = readString(dataIn); -//// ret = vf.createLiteral(label, language); -//// } else if (valueTypeMarker == RdfCloudTripleStoreConstants.DATATYPE_LITERAL_MARKER) { -//// String label = readString(dataIn); -//// URI datatype = (URI) readValue(dataIn, vf); -//// ret = vf.createLiteral(label, datatype); -//// } else { -//// throw new InvalidValueTypeMarkerRuntimeException(valueTypeMarker, "Invalid value type marker: " -//// + valueTypeMarker); -//// } -//// -//// return ret; -// } - -// public static void writeString(String s, ByteArrayDataOutput dataOut) -// throws IOException { -// dataOut.writeUTF(s); -// } -// -// public static String readString(ByteArrayDataInput dataIn) -// throws IOException { -// return dataIn.readUTF(); -// } -// -// public static byte[] writeContexts(Resource... contexts) throws IOException { -// if (contexts != null) { -// ByteArrayDataOutput cntxout = ByteStreams.newDataOutput(); -// for (Resource resource : contexts) { -// final byte[] context_bytes = RdfCloudTripleStoreUtils -// .writeValue(resource); -// cntxout.write(context_bytes); -// cntxout.write(RdfCloudTripleStoreConstants.DELIM_BYTES); -// } -// return cntxout.toByteArray(); -// } else -// return new byte[]{}; -// } -// -// public static List<Resource> readContexts(byte[] cont_arr, ValueFactory vf) -// throws IOException { -// List<Resource> contexts = new ArrayList<Resource>(); -// String conts_str = new String(cont_arr); -// String[] split = conts_str.split(RdfCloudTripleStoreConstants.DELIM); -// for (String string : split) { -// contexts.add((Resource) RdfCloudTripleStoreUtils.readValue(ByteStreams -// .newDataInput(string.getBytes()), vf)); -// } -// return contexts; -// } - -// public static Statement translateStatementFromRow(ByteArrayDataInput input, Text context, TABLE_LAYOUT tble, ValueFactory vf) throws IOException { -// Resource subject; -// URI predicate; -// Value object; -// if (TABLE_LAYOUT.SPO.equals(tble)) { -// subject = (Resource) RdfCloudTripleStoreUtils.readValue(input, vf); -// predicate = (URI) RdfCloudTripleStoreUtils.readValue(input, vf); -// object = RdfCloudTripleStoreUtils.readValue(input, vf); -// } else if (TABLE_LAYOUT.OSP.equals(tble)) { -// object = RdfCloudTripleStoreUtils.readValue(input, vf); -// subject = (Resource) RdfCloudTripleStoreUtils.readValue(input, vf); -// predicate = (URI) RdfCloudTripleStoreUtils.readValue(input, vf); -// } else if (TABLE_LAYOUT.PO.equals(tble)) { -// predicate = (URI) RdfCloudTripleStoreUtils.readValue(input, vf); -// object = RdfCloudTripleStoreUtils.readValue(input, vf); -// subject = (Resource) RdfCloudTripleStoreUtils.readValue(input, vf); -// } else { -// throw new IllegalArgumentException("Table[" + tble + "] is not valid"); -// } -// if (context == null || INFO_TXT.equals(context)) -// return new StatementImpl(subject, predicate, object); //default graph -// else -// return new ContextStatementImpl(subject, predicate, object, (Resource) readValue(ByteStreams.newDataInput(context.getBytes()), vf)); //TODO: Seems like a perf hog -// } - -// public static byte[] buildRowWith(byte[] bytes_one, byte[] bytes_two, byte[] bytes_three) throws IOException { -// ByteArrayDataOutput rowidout = ByteStreams.newDataOutput(); -// rowidout.write(bytes_one); -// rowidout.writeByte(DELIM_BYTE); -//// rowidout.write(RdfCloudTripleStoreConstants.DELIM_BYTES); -// rowidout.write(bytes_two); -// rowidout.writeByte(DELIM_BYTE); -//// rowidout.write(RdfCloudTripleStoreConstants.DELIM_BYTES); -// rowidout.write(bytes_three); -// return truncateRowId(rowidout.toByteArray()); -// } - -// public static byte[] truncateRowId(byte[] byteArray) { -// if (byteArray.length > 32000) { -// ByteArrayDataOutput stream = ByteStreams.newDataOutput(); -// stream.write(byteArray, 0, 32000); -// return stream.toByteArray(); -// } -// return byteArray; -// } - - - public static class CustomEntry<T, U> implements Map.Entry<T, U> { - - private T key; - private U value; - - public CustomEntry(T key, U value) { - this.key = key; - this.value = value; - } - - @Override - public T getKey() { - return key; - } - - @Override - public U getValue() { - return value; - } - - public T setKey(T key) { - this.key = key; - return this.key; - } - - @Override - public U setValue(U value) { - this.value = value; - return this.value; - } - - @Override - public String toString() { - return "CustomEntry{" + - "key=" + key + - ", value=" + value + - '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - CustomEntry that = (CustomEntry) o; - - if (key != null ? !key.equals(that.key) : that.key != null) return false; - if (value != null ? !value.equals(that.value) : that.value != null) return false; - - return true; - } - - @Override - public int hashCode() { - int result = key != null ? key.hashCode() : 0; - result = 31 * result + (value != null ? value.hashCode() : 0); - return result; - } - } - - /** - * If value is a URI, then return as URI, otherwise return namespace/value as the URI - * - * @param namespace - * @param value - * @return - */ - public static URI convertToUri(String namespace, String value) { - if (value == null) - return null; - URI subjUri; - try { - subjUri = valueFactory.createURI(value); - } catch (Exception e) { - //not uri - if (namespace == null) - return null; - subjUri = valueFactory.createURI(namespace, value); - } - return subjUri; - } - - public static Literal convertToDataTypeLiteral(String s) { - int i = s.indexOf("^^"); - if (i != -1) { - String val = s.substring(1, i - 1); - int dt_i_start = i + 2; - int dt_i_end = s.length(); - if (s.charAt(dt_i_start) == '<') { - dt_i_start = dt_i_start + 1; - dt_i_end = dt_i_end - 1; - } - - String dataType = s.substring(dt_i_start, dt_i_end); - return valueFactory.createLiteral(val, valueFactory.createURI(dataType)); - } - return null; - } - - public static boolean isDataTypeLiteral(String lit) { - return lit != null && lit.indexOf("^^") != -1; - } - - public static boolean isUri(String uri) { - if (uri == null) return false; - try { - valueFactory.createURI(uri); - } catch (Exception e) { - return false; - } - return true; - } - - -// public static boolean isQueryTimeBased(Configuration conf) { -// return (conf != null && conf.getBoolean(RdfCloudTripleStoreConfiguration.CONF_ISQUERYTIMEBASED, false)); -// } -// -// public static void setQueryTimeBased(Configuration conf, boolean timeBased) { -// if (conf != null) -// conf.setBoolean(RdfCloudTripleStoreConfiguration.CONF_ISQUERYTIMEBASED, isQueryTimeBased(conf) || timeBased); -// } - - -// public static void addTimeIndexUri(Configuration conf, URI timeUri, Class<? extends TtlValueConverter> ttlValueConvClass) { -// String[] timeIndexUris = conf.getStrings(RdfCloudTripleStoreConfiguration.CONF_TIMEINDEXURIS); -// if (timeIndexUris == null) -// timeIndexUris = new String[0]; -// List<String> stringList = new ArrayList<String>(Arrays.asList(timeIndexUris)); -// String timeUri_s = timeUri.stringValue(); -// if (!stringList.contains(timeUri_s)) -// stringList.add(timeUri_s); -// conf.setStrings(RdfCloudTripleStoreConfiguration.CONF_TIMEINDEXURIS, stringList.toArray(new String[stringList.size()])); -// conf.set(timeUri_s, ttlValueConvClass.getName()); -// } - -// public static Class<? extends TtlValueConverter> getTtlValueConverter(Configuration conf, URI predicate) throws ClassNotFoundException { -// if (predicate == null) -// return null; -// -// String[] s = conf.getStrings(RdfCloudTripleStoreConfiguration.CONF_TIMEINDEXURIS); -// if (s == null) -// return null; -// -// for (String uri : s) { -// if (predicate.stringValue().equals(uri)) { -// return (Class<? extends TtlValueConverter>) RdfCloudTripleStoreUtils.class.getClassLoader().loadClass(conf.get(uri)); -// } -// } -// return null; -// } - - public static String layoutToTable(TABLE_LAYOUT layout, RdfCloudTripleStoreConfiguration conf) { - TableLayoutStrategy tableLayoutStrategy = conf.getTableLayoutStrategy(); - return layoutToTable(layout, tableLayoutStrategy); - } - - public static String layoutToTable(TABLE_LAYOUT layout, TableLayoutStrategy tableLayoutStrategy) { - if (tableLayoutStrategy == null) { - tableLayoutStrategy = new TablePrefixLayoutStrategy(); - } - switch (layout) { - case SPO: { - return tableLayoutStrategy.getSpo(); - } - case PO: { - return tableLayoutStrategy.getPo(); - } - case OSP: { - return tableLayoutStrategy.getOsp(); - } - } - return null; - } - - public static String layoutPrefixToTable(TABLE_LAYOUT layout, String prefix) { - return layoutToTable(layout, new TablePrefixLayoutStrategy(prefix)); - } - - //helper methods to createValue - public static Value createValue(String resource) { - if (isBNode(resource)) - return new BNodeImpl(resource.substring(2)); - Literal literal; - if ((literal = makeLiteral(resource)) != null) - return literal; - if (resource.contains(":") || resource.contains("/") || resource.contains("#")) { - return new URIImpl(resource); - } else { - throw new RuntimeException((new StringBuilder()).append(resource).append(" is not a valid URI, blank node, or literal value").toString()); - } - } - - public static boolean isBNode(String resource) { - return resource.length() > 2 && resource.startsWith("_:"); - } - - public static boolean isLiteral(String resource) { - return literalPattern.matcher(resource).matches() || resource.startsWith("\"") && resource.endsWith("\"") && resource.length() > 1; - } - - public static boolean isURI(String resource) { - return !isBNode(resource) && !isLiteral(resource) && (resource.contains(":") || resource.contains("/") || resource.contains("#")); - } - - public static Literal makeLiteral(String resource) { - Matcher matcher = literalPattern.matcher(resource); - if (matcher.matches()) - if (null != matcher.group(4)) - return new LiteralImpl(matcher.group(1), new URIImpl(matcher.group(4))); - else - return new LiteralImpl(matcher.group(1), matcher.group(6)); - if (resource.startsWith("\"") && resource.endsWith("\"") && resource.length() > 1) - return new LiteralImpl(resource.substring(1, resource.length() - 1)); - else - return null; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/date/DateTimeTtlValueConverter.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/date/DateTimeTtlValueConverter.java b/common/rya.api/src/main/java/mvm/rya/api/date/DateTimeTtlValueConverter.java deleted file mode 100644 index 199b63d..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/date/DateTimeTtlValueConverter.java +++ /dev/null @@ -1,80 +0,0 @@ -package mvm.rya.api.date; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.Value; - -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -/** - * Class DateTimeTtlValueConverter - * @deprecated 2 - */ -public class DateTimeTtlValueConverter implements TtlValueConverter { - - private Value start, stop; - private TimeZone timeZone = TimeZone.getTimeZone("Zulu"); - - @Override - public void convert(String ttl, String startTime) { - try { - long start_l, stop_l; - long ttl_l = Long.parseLong(ttl); - stop_l = System.currentTimeMillis(); - if (startTime != null) - stop_l = Long.parseLong(startTime); - start_l = stop_l - ttl_l; - - GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance(); - cal.setTimeZone(getTimeZone()); - cal.setTimeInMillis(start_l); - DatatypeFactory factory = DatatypeFactory.newInstance(); - start = vf.createLiteral(factory.newXMLGregorianCalendar(cal)); - - cal.setTimeInMillis(stop_l); - stop = vf.createLiteral(factory.newXMLGregorianCalendar(cal)); - } catch (DatatypeConfigurationException e) { - throw new RuntimeException("Exception occurred creating DataTypeFactory", e); - } - } - - @Override - public Value getStart() { - return start; - } - - @Override - public Value getStop() { - return stop; - } - - public TimeZone getTimeZone() { - return timeZone; - } - - public void setTimeZone(TimeZone timeZone) { - this.timeZone = timeZone; - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/date/TimestampTtlStrValueConverter.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/date/TimestampTtlStrValueConverter.java b/common/rya.api/src/main/java/mvm/rya/api/date/TimestampTtlStrValueConverter.java deleted file mode 100644 index de4ff8b..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/date/TimestampTtlStrValueConverter.java +++ /dev/null @@ -1,56 +0,0 @@ -package mvm.rya.api.date; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.Value; - -/** - * Class TimestampTtlValueConverter - * @deprecated - */ -public class TimestampTtlStrValueConverter implements TtlValueConverter { - - private Value start, stop; - - @Override - public void convert(String ttl, String startTime) { - long start_l, stop_l; - long ttl_l = Long.parseLong(ttl); - stop_l = System.currentTimeMillis(); - if (startTime != null) - stop_l = Long.parseLong(startTime); - start_l = stop_l - ttl_l; - - start = vf.createLiteral(start_l + ""); - stop = vf.createLiteral(stop_l + ""); - } - - @Override - public Value getStart() { - return start; - } - - @Override - public Value getStop() { - return stop; - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/date/TimestampTtlValueConverter.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/date/TimestampTtlValueConverter.java b/common/rya.api/src/main/java/mvm/rya/api/date/TimestampTtlValueConverter.java deleted file mode 100644 index 75366dc..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/date/TimestampTtlValueConverter.java +++ /dev/null @@ -1,56 +0,0 @@ -package mvm.rya.api.date; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.Value; - -/** - * Class TimestampTtlValueConverter - * @deprecated - */ -public class TimestampTtlValueConverter implements TtlValueConverter { - - private Value start, stop; - - @Override - public void convert(String ttl, String startTime) { - long start_l, stop_l; - long ttl_l = Long.parseLong(ttl); - stop_l = System.currentTimeMillis(); - if (startTime != null) - stop_l = Long.parseLong(startTime); - start_l = stop_l - ttl_l; - - start = vf.createLiteral(start_l); - stop = vf.createLiteral(stop_l); - } - - @Override - public Value getStart() { - return start; - } - - @Override - public Value getStop() { - return stop; - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/date/TtlValueConverter.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/date/TtlValueConverter.java b/common/rya.api/src/main/java/mvm/rya/api/date/TtlValueConverter.java deleted file mode 100644 index 1ba9841..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/date/TtlValueConverter.java +++ /dev/null @@ -1,41 +0,0 @@ -package mvm.rya.api.date; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.Value; -import org.openrdf.model.ValueFactory; -import org.openrdf.model.impl.ValueFactoryImpl; - -/** - * Class TtlValueConverter - * @deprecated - */ -public interface TtlValueConverter { - - ValueFactory vf = ValueFactoryImpl.getInstance(); - - public void convert(String ttl, String startTime); - - public Value getStart(); - - public Value getStop(); -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/Node.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/Node.java b/common/rya.api/src/main/java/mvm/rya/api/domain/Node.java deleted file mode 100644 index f5ca08c..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/Node.java +++ /dev/null @@ -1,38 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.impl.URIImpl; - -/** - * A Node is an expected node in the global graph. This typing of the URI allows us to dictate the difference between a - * URI that is just an Attribute on the subject vs. a URI that is another subject Node in the global graph. It does not - * guarantee that the subject exists, just that there is an Edge to it. - */ -public class Node extends URIImpl { - public Node() { - } - - public Node(String uriString) { - super(uriString); - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RangeURI.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RangeURI.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RangeURI.java deleted file mode 100644 index 67d5742..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RangeURI.java +++ /dev/null @@ -1,52 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.URI; -import org.openrdf.model.Value; - -/** - * Created by IntelliJ IDEA. - * Date: 4/11/12 - * Time: 1:03 PM - * To change this template use File | Settings | File Templates. - */ -public class RangeURI extends RangeValue<URI> implements URI { - - public RangeURI(URI start, URI end) { - super(start, end); - } - - public RangeURI(RangeValue rangeValue) { - super((URI) rangeValue.getStart(), (URI) rangeValue.getEnd()); - } - - @Override - public String getNamespace() { - throw new UnsupportedOperationException("Ranges do not have a namespace"); - } - - @Override - public String getLocalName() { - throw new UnsupportedOperationException("Ranges do not have a localname"); - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RangeValue.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RangeValue.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RangeValue.java deleted file mode 100644 index c27edfd..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RangeValue.java +++ /dev/null @@ -1,72 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.Value; - -/** - * Created by IntelliJ IDEA. - * Date: 4/10/12 - * Time: 3:57 PM - * To change this template use File | Settings | File Templates. - */ -public class RangeValue<T extends Value> implements Value { - - private T start; - private T end; - - public RangeValue(T start, T end) { - this.start = start; - this.end = end; - } - - @Override - public String stringValue() { - throw new UnsupportedOperationException("Range is only supported at query time"); - } - - public T getStart() { - return start; - } - - public void setStart(T start) { - this.start = start; - } - - public T getEnd() { - return end; - } - - public void setEnd(T end) { - this.end = end; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RangeValue"); - sb.append("{start=").append(start); - sb.append(", end=").append(end); - sb.append('}'); - return sb.toString(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RyaRange.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaRange.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RyaRange.java deleted file mode 100644 index e99f451..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaRange.java +++ /dev/null @@ -1,32 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -/** - * Date: 7/17/12 - * Time: 10:02 AM - */ -public interface RyaRange { - public RyaType getStart(); - - public RyaType getStop(); -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RyaSchema.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaSchema.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RyaSchema.java deleted file mode 100644 index 6744d20..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaSchema.java +++ /dev/null @@ -1,43 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import mvm.rya.api.RdfCloudTripleStoreConstants; -import org.openrdf.model.URI; - -/** - * Date: 7/16/12 - * Time: 11:59 AM - */ -public class RyaSchema { - - public static final String NAMESPACE = "urn:mvm.rya/2012/05#"; - public static final String AUTH_NAMESPACE = "urn:mvm.rya/auth/2012/05#"; - public static final String BNODE_NAMESPACE = "urn:mvm.rya/bnode/2012/07#"; - - //datatypes - public static final URI NODE = RdfCloudTripleStoreConstants.VALUE_FACTORY.createURI(NAMESPACE, "node"); - public static final URI LANGUAGE = RdfCloudTripleStoreConstants.VALUE_FACTORY.createURI(NAMESPACE, "lang"); - - //functions - public static final URI RANGE = RdfCloudTripleStoreConstants.VALUE_FACTORY.createURI(NAMESPACE, "range"); -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RyaStatement.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaStatement.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RyaStatement.java deleted file mode 100644 index 18bde98..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaStatement.java +++ /dev/null @@ -1,252 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import java.util.Arrays; - -/** - * Date: 7/17/12 - * Time: 7:20 AM - */ -public class RyaStatement { - private RyaURI subject; - private RyaURI predicate; - private RyaType object; - private RyaURI context; - private String qualifer; - private byte[] columnVisibility; - private byte[] value; - private Long timestamp; - - public RyaStatement() { - } - - public RyaStatement(RyaURI subject, RyaURI predicate, RyaType object) { - this(subject, predicate, object, null); - } - - public RyaStatement(RyaURI subject, RyaURI predicate, RyaType object, RyaURI context) { - this(subject, predicate, object, context, null); - } - - public RyaStatement(RyaURI subject, RyaURI predicate, RyaType object, RyaURI context, String qualifier) { - this(subject, predicate, object, context, qualifier, null); - } - - public RyaStatement(RyaURI subject, RyaURI predicate, RyaType object, RyaURI context, String qualifier, byte[] columnVisibility) { - this(subject, predicate, object, context, qualifier, columnVisibility, null); - } - - public RyaStatement(RyaURI subject, RyaURI predicate, RyaType object, RyaURI context, String qualifier, byte[] columnVisibility, byte[] value) { - this(subject, predicate, object, context, qualifier, columnVisibility, value, null); - } - - public RyaStatement(RyaURI subject, RyaURI predicate, RyaType object, RyaURI context, String qualifier, byte[] columnVisibility, byte[] value, Long timestamp) { - this.subject = subject; - this.predicate = predicate; - this.object = object; - this.context = context; - this.qualifer = qualifier; - this.columnVisibility = columnVisibility; - this.value = value; - this.timestamp = timestamp != null ? timestamp : System.currentTimeMillis(); - } - - public RyaURI getSubject() { - return subject; - } - - public void setSubject(RyaURI subject) { - this.subject = subject; - } - - public RyaURI getPredicate() { - return predicate; - } - - public void setPredicate(RyaURI predicate) { - this.predicate = predicate; - } - - public RyaType getObject() { - return object; - } - - public void setObject(RyaType object) { - this.object = object; - } - - public RyaURI getContext() { - return context; - } - - public void setContext(RyaURI context) { - this.context = context; - } - - public byte[] getColumnVisibility() { - return columnVisibility; - } - - public void setColumnVisibility(byte[] columnVisibility) { - this.columnVisibility = columnVisibility; - } - - public byte[] getValue() { - return value; - } - - public void setValue(byte[] value) { - this.value = value; - } - - public Long getTimestamp() { - return timestamp; - } - - public void setTimestamp(Long timestamp) { - this.timestamp = timestamp; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - RyaStatement that = (RyaStatement) o; - - if (!Arrays.equals(columnVisibility, that.columnVisibility)) return false; - if (context != null ? !context.equals(that.context) : that.context != null) return false; - if (object != null ? !object.equals(that.object) : that.object != null) return false; - if (predicate != null ? !predicate.equals(that.predicate) : that.predicate != null) return false; - if (qualifer != null ? !qualifer.equals(that.qualifer) : that.qualifer != null) return false; - if (subject != null ? !subject.equals(that.subject) : that.subject != null) return false; - if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) return false; - if (!Arrays.equals(value, that.value)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = subject != null ? subject.hashCode() : 0; - result = 31 * result + (predicate != null ? predicate.hashCode() : 0); - result = 31 * result + (object != null ? object.hashCode() : 0); - result = 31 * result + (context != null ? context.hashCode() : 0); - result = 31 * result + (qualifer != null ? qualifer.hashCode() : 0); - result = 31 * result + (columnVisibility != null ? Arrays.hashCode(columnVisibility) : 0); - result = 31 * result + (value != null ? Arrays.hashCode(value) : 0); - result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0); - return result; - } - - public String getQualifer() { - return qualifer; - } - - public void setQualifer(String qualifer) { - this.qualifer = qualifer; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RyaStatement"); - sb.append("{subject=").append(subject); - sb.append(", predicate=").append(predicate); - sb.append(", object=").append(object); - sb.append(", context=").append(context); - sb.append(", qualifier=").append(qualifer); - sb.append(", columnVisibility=").append(columnVisibility == null ? "null" : new String(columnVisibility)); - sb.append(", value=").append(value == null ? "null" : new String(value)); - sb.append(", timestamp=").append(timestamp); - sb.append('}'); - return sb.toString(); - } - - public static RyaStatementBuilder builder() { - return new RyaStatementBuilder(); - } - - public static RyaStatementBuilder builder(RyaStatement ryaStatement) { - return new RyaStatementBuilder(ryaStatement); - } - - - //builder - public static class RyaStatementBuilder { - - RyaStatement ryaStatement; - - public RyaStatementBuilder() { - ryaStatement = new RyaStatement(); - } - - public RyaStatementBuilder(RyaStatement ryaStatement) { - this.ryaStatement = ryaStatement; - } - - public RyaStatementBuilder setTimestamp(Long timestamp) { - ryaStatement.setTimestamp(timestamp); - return this; - } - - public RyaStatementBuilder setValue(byte[] value) { - ryaStatement.setValue(value); - return this; - } - - public RyaStatementBuilder setColumnVisibility(byte[] columnVisibility) { - ryaStatement.setColumnVisibility(columnVisibility); - return this; - } - - public RyaStatementBuilder setQualifier(String str) { - ryaStatement.setQualifer(str); - return this; - } - - public RyaStatementBuilder setContext(RyaURI ryaURI) { - ryaStatement.setContext(ryaURI); - return this; - } - - public RyaStatementBuilder setSubject(RyaURI ryaURI) { - ryaStatement.setSubject(ryaURI); - return this; - } - - public RyaStatementBuilder setPredicate(RyaURI ryaURI) { - ryaStatement.setPredicate(ryaURI); - return this; - } - - public RyaStatementBuilder setObject(RyaType ryaType) { - ryaStatement.setObject(ryaType); - return this; - } - - public RyaStatement build() { - return ryaStatement; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RyaType.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaType.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RyaType.java deleted file mode 100644 index ab580d6..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaType.java +++ /dev/null @@ -1,111 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - - -import org.openrdf.model.URI; -import org.openrdf.model.vocabulary.XMLSchema; - -/** - * Base Rya Type - * Date: 7/16/12 - * Time: 11:45 AM - */ -public class RyaType implements Comparable { - - private URI dataType; - private String data; - - public RyaType() { - setDataType(XMLSchema.STRING); - } - - public RyaType(String data) { - this(XMLSchema.STRING, data); - } - - - public RyaType(URI dataType, String data) { - setDataType(dataType); - setData(data); - } - - /** - * TODO: Can we get away without using the openrdf URI - * - * @return - */ - public URI getDataType() { - return dataType; - } - - public String getData() { - return data; - } - - public void setDataType(URI dataType) { - this.dataType = dataType; - } - - public void setData(String data) { - this.data = data; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RyaType"); - sb.append("{dataType=").append(dataType); - sb.append(", data='").append(data).append('\''); - sb.append('}'); - return sb.toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - RyaType ryaType = (RyaType) o; - - if (data != null ? !data.equals(ryaType.data) : ryaType.data != null) return false; - if (dataType != null ? !dataType.equals(ryaType.dataType) : ryaType.dataType != null) return false; - - return true; - } - - @Override - public int hashCode() { - int result = dataType != null ? dataType.hashCode() : 0; - result = 31 * result + (data != null ? data.hashCode() : 0); - return result; - } - - @Override - public int compareTo(Object o) { - if (o != null && this.getClass().isInstance(o)) { - RyaType other = (RyaType) o; - return this.getData().compareTo(other.getData()); - } - return -1; - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RyaTypePrefix.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaTypePrefix.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RyaTypePrefix.java deleted file mode 100644 index d394417..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaTypePrefix.java +++ /dev/null @@ -1,59 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.URI; - -import static mvm.rya.api.RdfCloudTripleStoreConstants.DELIM; -import static mvm.rya.api.RdfCloudTripleStoreConstants.LAST; - -/** - * Date: 7/24/12 - * Time: 3:26 PM - */ -public class RyaTypePrefix extends RyaTypeRange { - - public RyaTypePrefix(URI datatype, String prefix) { - super(); - setPrefix(datatype, prefix); - } - - public RyaTypePrefix(String prefix) { - super(); - setPrefix(prefix); - } - - public void setPrefix(String prefix) { - setStart(new RyaType(prefix + DELIM)); - setStop(new RyaType(prefix + LAST)); - } - - public void setPrefix(URI datatype, String prefix) { - setStart(new RyaType(datatype, prefix + DELIM)); - setStop(new RyaType(datatype, prefix + LAST)); - } - - public String getPrefix() { - String data = getStart().getData(); - return data.substring(0, data.length() - 1); - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RyaTypeRange.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaTypeRange.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RyaTypeRange.java deleted file mode 100644 index a744399..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaTypeRange.java +++ /dev/null @@ -1,99 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.URI; - -/** - * Date: 7/17/12 - * Time: 9:53 AM - */ -public class RyaTypeRange extends RyaType implements RyaRange { - private RyaType start; - private RyaType stop; - - public RyaTypeRange() { - } - - public RyaTypeRange(RyaType start, RyaType stop) { - this.start = start; - this.stop = stop; - } - - public RyaType getStart() { - return start; - } - - public void setStart(RyaType start) { - this.start = start; - } - - public RyaType getStop() { - return stop; - } - - public void setStop(RyaType stop) { - this.stop = stop; - } - - @Override - public URI getDataType() { - return start.getDataType(); - } - - @Override - public String getData() { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RyaTypeRange"); - sb.append("{start=").append(start); - sb.append(", stop=").append(stop); - sb.append('}'); - return sb.toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - RyaTypeRange that = (RyaTypeRange) o; - - if (start != null ? !start.equals(that.start) : that.start != null) return false; - if (stop != null ? !stop.equals(that.stop) : that.stop != null) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (start != null ? start.hashCode() : 0); - result = 31 * result + (stop != null ? stop.hashCode() : 0); - return result; - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURI.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURI.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURI.java deleted file mode 100644 index aa174c5..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURI.java +++ /dev/null @@ -1,63 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import org.openrdf.model.URI; -import org.openrdf.model.util.URIUtil; -import org.openrdf.model.vocabulary.XMLSchema; - - -/** - * Date: 7/16/12 - * Time: 11:56 AM - */ -public class RyaURI extends RyaType { - - public RyaURI() { - setDataType(XMLSchema.ANYURI); - } - - public RyaURI(String data) { - super(XMLSchema.ANYURI, data); - } - - public RyaURI(String namespace, String data) { - super(XMLSchema.ANYURI, namespace + data); - } - - protected RyaURI(URI datatype, String data) { - super(datatype, data); - } - - @Override - public void setData(String data) { - super.setData(data); - validate(data); - } - - protected void validate(String data) { - if (data == null) - throw new IllegalArgumentException("Null not URI"); - URIUtil.getLocalNameIndex(data); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURIPrefix.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURIPrefix.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURIPrefix.java deleted file mode 100644 index f808607..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURIPrefix.java +++ /dev/null @@ -1,47 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import mvm.rya.api.RdfCloudTripleStoreConstants; - -/** - * Date: 7/24/12 - * Time: 3:26 PM - */ -public class RyaURIPrefix extends RyaURIRange { - public static final String LAST = "\u00FF"; - - public RyaURIPrefix(String prefix) { - super(); - setPrefix(prefix); - } - - public void setPrefix(String prefix) { - setStart(new RyaURI(prefix + RdfCloudTripleStoreConstants.DELIM)); - setStop(new RyaURI(prefix + LAST)); - } - - public String getPrefix() { - String data = getStart().getData(); - return data.substring(0, data.length() - 1); - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURIRange.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURIRange.java b/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURIRange.java deleted file mode 100644 index 2c2b836..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/RyaURIRange.java +++ /dev/null @@ -1,95 +0,0 @@ -package mvm.rya.api.domain; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -/** - * Date: 7/17/12 - * Time: 9:59 AM - */ -public class RyaURIRange extends RyaURI implements RyaRange { - public static final RyaURI LAST_URI = new RyaURI(((char) 255) + ":#" + ((char) 255)); - - private RyaURI start; - private RyaURI stop; - - public RyaURIRange() { - super(); - } - - public RyaURIRange(RyaURI start, RyaURI stop) { - this.start = start; - this.stop = stop; - } - - public RyaURI getStart() { - return start; - } - - public void setStart(RyaURI start) { - this.start = start; - } - - public RyaURI getStop() { - return stop; - } - - public void setStop(RyaURI stop) { - this.stop = stop; - } - - @Override - public String getData() { - throw new UnsupportedOperationException(); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RyaURIRange"); - sb.append("{start=").append(start); - sb.append(", stop=").append(stop); - sb.append('}'); - return sb.toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - RyaURIRange that = (RyaURIRange) o; - - if (start != null ? !start.equals(that.start) : that.start != null) return false; - if (stop != null ? !stop.equals(that.stop) : that.stop != null) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (start != null ? start.hashCode() : 0); - result = 31 * result + (stop != null ? stop.hashCode() : 0); - return result; - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/domain/utils/RyaStatementWritable.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/domain/utils/RyaStatementWritable.java b/common/rya.api/src/main/java/mvm/rya/api/domain/utils/RyaStatementWritable.java deleted file mode 100644 index 13d82da..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/domain/utils/RyaStatementWritable.java +++ /dev/null @@ -1,140 +0,0 @@ -package mvm.rya.api.domain.utils; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; -import java.util.Map; - -import mvm.rya.api.RdfCloudTripleStoreConstants; -import mvm.rya.api.domain.RyaStatement; -import mvm.rya.api.resolver.RyaTripleContext; -import mvm.rya.api.resolver.triple.TripleRow; -import mvm.rya.api.resolver.triple.TripleRowResolverException; - -import org.apache.hadoop.io.WritableComparable; - -/** - * Date: 7/17/12 - * Time: 1:29 PM - */ -public class RyaStatementWritable implements WritableComparable { - - private RyaTripleContext ryaContext; - private RyaStatement ryaStatement; - - - public RyaStatementWritable(RyaTripleContext ryaContext) { - this.ryaContext = ryaContext; - } - - public RyaStatementWritable(RyaStatement ryaStatement, RyaTripleContext ryaContext) { - this(ryaContext); - this.ryaStatement = ryaStatement; - } - - public RyaStatement getRyaStatement() { - return ryaStatement; - } - - public void setRyaStatement(RyaStatement ryaStatement) { - this.ryaStatement = ryaStatement; - } - - @Override - public int compareTo(Object o) { - if (o instanceof RyaStatementWritable) { - return (getRyaStatement().equals(((RyaStatementWritable) o).getRyaStatement())) ? (0) : (-1); - } - return -1; - } - - @Override - public void write(DataOutput dataOutput) throws IOException { - if (ryaStatement == null) { - throw new IOException("Rya Statement is null"); - } - try { - Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> map = ryaContext.serializeTriple(ryaStatement); - TripleRow tripleRow = map.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO); - byte[] row = tripleRow.getRow(); - byte[] columnFamily = tripleRow.getColumnFamily(); - byte[] columnQualifier = tripleRow.getColumnQualifier(); - write(dataOutput, row); - write(dataOutput, columnFamily); - write(dataOutput, columnQualifier); - write(dataOutput, ryaStatement.getColumnVisibility()); - write(dataOutput, ryaStatement.getValue()); - Long timestamp = ryaStatement.getTimestamp(); - boolean b = timestamp != null; - if (b) { - dataOutput.writeBoolean(b); - dataOutput.writeLong(timestamp); - } - } catch (TripleRowResolverException e) { - throw new IOException(e); - } - } - - protected void write(DataOutput dataOutput, byte[] row) throws IOException { - boolean b = row != null; - dataOutput.writeBoolean(b); - if (b) { - dataOutput.writeInt(row.length); - dataOutput.write(row); - } - } - - protected byte[] read(DataInput dataInput) throws IOException { - if (dataInput.readBoolean()) { - int len = dataInput.readInt(); - byte[] bytes = new byte[len]; - dataInput.readFully(bytes); - return bytes; - } - return null; - } - - @Override - public void readFields(DataInput dataInput) throws IOException { - byte[] row = read(dataInput); - byte[] columnFamily = read(dataInput); - byte[] columnQualifier = read(dataInput); - byte[] columnVisibility = read(dataInput); - byte[] value = read(dataInput); - boolean b = dataInput.readBoolean(); - Long timestamp = null; - if (b) { - timestamp = dataInput.readLong(); - } - try { - ryaStatement = ryaContext.deserializeTriple(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO, - new TripleRow(row, columnFamily, columnQualifier)); - ryaStatement.setColumnVisibility(columnVisibility); - ryaStatement.setValue(value); - ryaStatement.setTimestamp(timestamp); - } catch (TripleRowResolverException e) { - throw new IOException(e); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/layout/TableLayoutStrategy.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/layout/TableLayoutStrategy.java b/common/rya.api/src/main/java/mvm/rya/api/layout/TableLayoutStrategy.java deleted file mode 100644 index 61732d3..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/layout/TableLayoutStrategy.java +++ /dev/null @@ -1,40 +0,0 @@ -package mvm.rya.api.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -/** - * Created by IntelliJ IDEA. - * Date: 4/25/12 - * Time: 12:20 PM - * To change this template use File | Settings | File Templates. - */ -public interface TableLayoutStrategy { - - public String getSpo(); - public String getPo(); - public String getOsp(); - public String getNs(); - public String getEval(); - public String getProspects(); - public String getSelectivity(); - -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/layout/TablePrefixLayoutStrategy.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/layout/TablePrefixLayoutStrategy.java b/common/rya.api/src/main/java/mvm/rya/api/layout/TablePrefixLayoutStrategy.java deleted file mode 100644 index 0e995ab..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/layout/TablePrefixLayoutStrategy.java +++ /dev/null @@ -1,85 +0,0 @@ -package mvm.rya.api.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import mvm.rya.api.RdfCloudTripleStoreConstants; - -/** - * Created by IntelliJ IDEA. - * Date: 4/25/12 - * Time: 12:20 PM - * To change this template use File | Settings | File Templates. - */ -public class TablePrefixLayoutStrategy implements TableLayoutStrategy{ - private String tablePrefix = RdfCloudTripleStoreConstants.TBL_PRFX_DEF; - - public TablePrefixLayoutStrategy() { - } - - public TablePrefixLayoutStrategy(String tablePrefix) { - this.tablePrefix = tablePrefix; - } - - @Override - public String getSpo() { - return tablePrefix + RdfCloudTripleStoreConstants.TBL_SPO_SUFFIX; - } - - @Override - public String getPo() { - return tablePrefix + RdfCloudTripleStoreConstants.TBL_PO_SUFFIX; - } - - @Override - public String getOsp() { - return tablePrefix + RdfCloudTripleStoreConstants.TBL_OSP_SUFFIX; - } - - @Override - public String getNs() { - return tablePrefix + RdfCloudTripleStoreConstants.TBL_NS_SUFFIX; - } - - @Override - public String getEval() { - return tablePrefix + RdfCloudTripleStoreConstants.TBL_EVAL_SUFFIX; - } - - @Override - public String getProspects() { - return tablePrefix + RdfCloudTripleStoreConstants.TBL_STATS_SUFFIX; - } - - @Override - public String getSelectivity() { - return tablePrefix + RdfCloudTripleStoreConstants.TBL_SEL_SUFFIX; - } - - - public String getTablePrefix() { - return tablePrefix; - } - - public void setTablePrefix(String tablePrefix) { - this.tablePrefix = tablePrefix; - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/persist/RdfDAOException.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/persist/RdfDAOException.java b/common/rya.api/src/main/java/mvm/rya/api/persist/RdfDAOException.java deleted file mode 100644 index 54444d4..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/persist/RdfDAOException.java +++ /dev/null @@ -1,44 +0,0 @@ -package mvm.rya.api.persist; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -/** - * Class RdfDAOException - * Date: Feb 28, 2012 - * Time: 3:39:36 PM - */ -public class RdfDAOException extends RuntimeException { - public RdfDAOException() { - } - - public RdfDAOException(String s) { - super(s); - } - - public RdfDAOException(String s, Throwable throwable) { - super(s, throwable); - } - - public RdfDAOException(Throwable throwable) { - super(throwable); - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/persist/RdfEvalStatsDAO.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/persist/RdfEvalStatsDAO.java b/common/rya.api/src/main/java/mvm/rya/api/persist/RdfEvalStatsDAO.java deleted file mode 100644 index 020464b..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/persist/RdfEvalStatsDAO.java +++ /dev/null @@ -1,54 +0,0 @@ -package mvm.rya.api.persist; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import java.util.List; - -import mvm.rya.api.RdfCloudTripleStoreConfiguration; - -import org.openrdf.model.Resource; -import org.openrdf.model.Value; - -/** - * Class RdfEvalStatsDAO - * Date: Feb 28, 2012 - * Time: 4:17:05 PM - */ -public interface RdfEvalStatsDAO<C extends RdfCloudTripleStoreConfiguration> { - public enum CARDINALITY_OF { - SUBJECT, PREDICATE, OBJECT, SUBJECTPREDICATE, SUBJECTOBJECT, PREDICATEOBJECT - } - - public void init() throws RdfDAOException; - - public boolean isInitialized() throws RdfDAOException; - - public void destroy() throws RdfDAOException; - - public double getCardinality(C conf, CARDINALITY_OF card, List<Value> val) throws RdfDAOException; - public double getCardinality(C conf, CARDINALITY_OF card, List<Value> val, Resource context) throws RdfDAOException; - - public void setConf(C conf); - - public C getConf(); - -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/persist/RyaConfigured.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/persist/RyaConfigured.java b/common/rya.api/src/main/java/mvm/rya/api/persist/RyaConfigured.java deleted file mode 100644 index 00c246e..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/persist/RyaConfigured.java +++ /dev/null @@ -1,35 +0,0 @@ -package mvm.rya.api.persist; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import mvm.rya.api.RdfCloudTripleStoreConfiguration; - -/** - * Date: 7/17/12 - * Time: 8:24 AM - */ -public interface RyaConfigured<C extends RdfCloudTripleStoreConfiguration> { - - public void setConf(C conf); - - public C getConf(); -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/persist/RyaDAO.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/persist/RyaDAO.java b/common/rya.api/src/main/java/mvm/rya/api/persist/RyaDAO.java deleted file mode 100644 index e326f7d..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/persist/RyaDAO.java +++ /dev/null @@ -1,126 +0,0 @@ -package mvm.rya.api.persist; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import java.util.Iterator; - -import mvm.rya.api.RdfCloudTripleStoreConfiguration; -import mvm.rya.api.domain.RyaStatement; -import mvm.rya.api.domain.RyaURI; -import mvm.rya.api.persist.query.RyaQueryEngine; - -/** - * Provides the access layer to the Rya triple store. - * - * Date: Feb 28, 2012 - * Time: 3:30:14 PM - */ -public interface RyaDAO<C extends RdfCloudTripleStoreConfiguration> extends RyaConfigured<C> { - - /** - * Initialize the RyaDAO. Should only be called once, otherwise, if already initialized, it will - * throw an exception. - * - * @throws RyaDAOException - */ - public void init() throws RyaDAOException; - - /** - * - * @return true if the store is already initiailized - * @throws RyaDAOException - */ - public boolean isInitialized() throws RyaDAOException; - - /** - * Shutdown the store. To reinitialize, call the init() method. - * - * @throws RyaDAOException - */ - public void destroy() throws RyaDAOException; - - /** - * Add and commit a single RyaStatement - * - * @param statement - * @throws RyaDAOException - */ - public void add(RyaStatement statement) throws RyaDAOException; - - /** - * Add and commit a collection of RyaStatements - * - * @param statement - * @throws RyaDAOException - */ - public void add(Iterator<RyaStatement> statement) throws RyaDAOException; - - /** - * Delete a RyaStatement. The Configuration should provide the auths to perform the delete - * - * @param statement - * @param conf - * @throws RyaDAOException - */ - public void delete(RyaStatement statement, C conf) throws RyaDAOException; - - /** - * Drop a set of Graphs. The Configuration should provide the auths to perform the delete - * - * @param conf - * @throws RyaDAOException - */ - public void dropGraph(C conf, RyaURI... graphs) throws RyaDAOException; - - /** - * Delete a collection of RyaStatements. - * - * @param statements - * @param conf - * @throws RyaDAOException - */ - public void delete(Iterator<RyaStatement> statements, C conf) throws RyaDAOException; - - /** - * Get the version of the store. - * - * @return - * @throws RyaDAOException - */ - public String getVersion() throws RyaDAOException; - - /** - * Get the Rya query engine - * @return - */ - public RyaQueryEngine<C> getQueryEngine(); - - /** - * Get the Rya Namespace Manager - * @return - */ - public RyaNamespaceManager<C> getNamespaceManager(); - - public void purge(RdfCloudTripleStoreConfiguration configuration); - - public void dropAndDestroy() throws RyaDAOException; -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/persist/RyaDAOException.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/persist/RyaDAOException.java b/common/rya.api/src/main/java/mvm/rya/api/persist/RyaDAOException.java deleted file mode 100644 index 2322119..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/persist/RyaDAOException.java +++ /dev/null @@ -1,43 +0,0 @@ -package mvm.rya.api.persist; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -/** - * Date: 7/17/12 - * Time: 8:20 AM - */ -public class RyaDAOException extends Exception { - public RyaDAOException() { - } - - public RyaDAOException(String s) { - super(s); - } - - public RyaDAOException(String s, Throwable throwable) { - super(s, throwable); - } - - public RyaDAOException(Throwable throwable) { - super(throwable); - } -} http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/5a03ef61/common/rya.api/src/main/java/mvm/rya/api/persist/RyaNamespaceManager.java ---------------------------------------------------------------------- diff --git a/common/rya.api/src/main/java/mvm/rya/api/persist/RyaNamespaceManager.java b/common/rya.api/src/main/java/mvm/rya/api/persist/RyaNamespaceManager.java deleted file mode 100644 index 77cd4bd..0000000 --- a/common/rya.api/src/main/java/mvm/rya/api/persist/RyaNamespaceManager.java +++ /dev/null @@ -1,41 +0,0 @@ -package mvm.rya.api.persist; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - -import info.aduna.iteration.CloseableIteration; -import mvm.rya.api.RdfCloudTripleStoreConfiguration; -import org.openrdf.model.Namespace; - -/** - * Date: 7/17/12 - * Time: 8:23 AM - */ -public interface RyaNamespaceManager<C extends RdfCloudTripleStoreConfiguration> extends RyaConfigured<C> { - - public void addNamespace(String pfx, String namespace) throws RyaDAOException; - - public String getNamespace(String pfx) throws RyaDAOException; - - public void removeNamespace(String pfx) throws RyaDAOException; - - public CloseableIteration<? extends Namespace, RyaDAOException> iterateNamespace() throws RyaDAOException; -}
