|
From: <mrp...@us...> - 2010-07-21 19:49:16
|
Revision: 3261
http://bigdata.svn.sourceforge.net/bigdata/?rev=3261&view=rev
Author: mrpersonick
Date: 2010-07-21 19:49:10 +0000 (Wed, 21 Jul 2010)
Log Message:
-----------
renamed a bunch of stuff and added support for inline bnodes
Added Paths:
-----------
branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractBNodeIV.java
branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/NumericBNodeIV.java
Added: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractBNodeIV.java
===================================================================
--- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractBNodeIV.java (rev 0)
+++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractBNodeIV.java 2010-07-21 19:49:10 UTC (rev 3261)
@@ -0,0 +1,68 @@
+/**
+
+Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved.
+
+Contact:
+ SYSTAP, LLC
+ 4501 Tower Road
+ Greensboro, NC 27410
+ lic...@bi...
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+package com.bigdata.rdf.internal;
+
+import com.bigdata.rdf.model.BigdataBNode;
+import com.bigdata.rdf.model.BigdataValueFactory;
+import com.bigdata.rdf.store.AbstractTripleStore;
+
+/**
+ * Class for inline RDF blank nodes. Blank nodes MUST be based on UUIDs or
+ * some other numeric in order to be inlined.
+ * <p>
+ * {@inheritDoc}
+ *
+ * @author <a href="mailto:tho...@us...">Bryan
+ * Thompson</a>
+ * @version $Id: TestEncodeDecodeKeys.java 2753 2010-05-01 16:36:59Z
+ * thompsonbry $
+ *
+ * @see AbstractTripleStore.Options
+ */
+abstract public class AbstractBNodeIV<V extends BigdataBNode, T> extends
+ AbstractInlineIV<V, T> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -4560216387427028030L;
+
+ public AbstractBNodeIV(DTE dte) {
+
+ super(VTE.BNODE, dte);
+
+ }
+
+ final public long getTermId() {
+ throw new UnsupportedOperationException();
+ }
+
+ public V asValue(BigdataValueFactory f)
+ throws UnsupportedOperationException {
+ final V bnode = (V) f.createBNode(stringValue());
+ bnode.setIV(this);
+ return bnode;
+ }
+
+}
\ No newline at end of file
Added: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/NumericBNodeIV.java
===================================================================
--- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/NumericBNodeIV.java (rev 0)
+++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/NumericBNodeIV.java 2010-07-21 19:49:10 UTC (rev 3261)
@@ -0,0 +1,87 @@
+/**
+
+Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved.
+
+Contact:
+ SYSTAP, LLC
+ 4501 Tower Road
+ Greensboro, NC 27410
+ lic...@bi...
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+package com.bigdata.rdf.internal;
+
+import com.bigdata.rawstore.Bytes;
+import com.bigdata.rdf.model.BigdataBNode;
+import com.bigdata.rdf.store.AbstractTripleStore;
+
+/**
+ * Class for inline RDF blank nodes. Blank nodes MUST be based on a numeric
+ * value to be inlined with this class.
+ * <p>
+ * {@inheritDoc}
+ *
+ * @author <a href="mailto:tho...@us...">Bryan
+ * Thompson</a>
+ * @version $Id: TestEncodeDecodeKeys.java 2753 2010-05-01 16:36:59Z
+ * thompsonbry $
+ *
+ * @see AbstractTripleStore.Options
+ */
+public class NumericBNodeIV<V extends BigdataBNode> extends
+ AbstractBNodeIV<V, Integer> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2057725744604560753L;
+
+ private final int id;
+
+ public NumericBNodeIV(final int id) {
+
+ super(DTE.XSDInt);
+
+ this.id = id;
+
+ }
+
+ @Override
+ public String stringValue() {
+ return String.valueOf(id);
+ }
+
+ final public Integer getInlineValue() {
+ return id;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o instanceof NumericBNodeIV<?>) {
+ return this.id == ((NumericBNodeIV<?>) o).id;
+ }
+ return false;
+ }
+
+ public int hashCode() {
+ return id;
+ }
+
+ public int byteLength() {
+ return 1 + Bytes.SIZEOF_INT;
+ }
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|