You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2014/10/20 16:47:39 UTC
[17/50] [abbrv] Move Jena Hadoop RDF Tools into new location for
merging into main git repository
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/KeyReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/KeyReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/KeyReducer.java
deleted file mode 100644
index 7805f16..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/KeyReducer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-
-import org.apache.hadoop.mapreduce.Reducer;
-
-/**
- * A reducer that outputs a single pair consists of the key as both fields ignoring the values
- * @author rvesse
- *
- * @param <TKey> Key
- * @param <TValue> Value
- */
-public class KeyReducer<TKey, TValue> extends Reducer<TKey, TValue, TKey, TKey> {
-
- @Override
- protected void reduce(TKey key, Iterable<TValue> values, Context context)
- throws IOException, InterruptedException {
- context.write(key, key);
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusKeyMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusKeyMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusKeyMapper.java
deleted file mode 100644
index 7a48c1d..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusKeyMapper.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.Mapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A mapper which discards the value, moves the key to the value position and uses a null key
- *
- *
- * @param <TKey> Key type
- * @param <TValue> Value type
- */
-public class NullPlusKeyMapper<TKey, TValue> extends Mapper<TKey, TValue, NullWritable, TKey> {
- private static final Logger LOG = LoggerFactory.getLogger(NullPlusKeyMapper.class);
-
- private boolean tracing = false;
-
- @Override
- protected void setup(Context context) throws IOException, InterruptedException {
- super.setup(context);
- this.tracing = LOG.isTraceEnabled();
- }
-
- @Override
- protected void map(TKey key, TValue value, Context context) throws IOException,
- InterruptedException {
- if (this.tracing) {
- LOG.trace("Key = {}", key);
- }
- context.write(NullWritable.get(), key);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusKeyReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusKeyReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusKeyReducer.java
deleted file mode 100644
index dfc6ec1..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusKeyReducer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.Reducer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A reducer that outputs a single pair consists of a null as the key and the key as the value
- * @author rvesse
- *
- * @param <TKey> Key
- * @param <TValue> Value
- */
-public class NullPlusKeyReducer<TKey, TValue> extends Reducer<TKey, TValue, NullWritable, TKey> {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(NullPlusKeyReducer.class);
- private boolean tracing = false;
-
- @Override
- protected void setup(Context context) throws IOException, InterruptedException {
- super.setup(context);
- this.tracing = LOGGER.isTraceEnabled();
- }
-
- @Override
- protected void reduce(TKey key, Iterable<TValue> values, Context context)
- throws IOException, InterruptedException {
- if (this.tracing) {
- LOGGER.trace("Input Key = {}", key);
- Iterator<TValue> iter = values.iterator();
- while (iter.hasNext()) {
- LOGGER.trace("Input Value = {}", iter.next());
- }
- }
- context.write(NullWritable.get(), key);
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusValueMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusValueMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusValueMapper.java
deleted file mode 100644
index a5ac199..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusValueMapper.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.Mapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A mapper which discards the key replacing it with a null leaving the value as is
- *
- *
- * @param <TKey> Key type
- * @param <TValue> Value type
- */
-public class NullPlusValueMapper<TKey, TValue> extends Mapper<TKey, TValue, NullWritable, TValue> {
- private static final Logger LOG = LoggerFactory.getLogger(NullPlusValueMapper.class);
-
- private boolean tracing = false;
-
- @Override
- protected void setup(Context context) throws IOException, InterruptedException {
- super.setup(context);
- this.tracing = LOG.isTraceEnabled();
- }
-
- @Override
- protected void map(TKey key, TValue value, Context context) throws IOException,
- InterruptedException {
- if (this.tracing) {
- LOG.trace("Value = {}", value);
- }
- context.write(NullWritable.get(), value);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusValueReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusValueReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusValueReducer.java
deleted file mode 100644
index c6b270f..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/NullPlusValueReducer.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.Reducer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A reducer that outputs a pair for each value consisting of a null key and the
- * value
- *
- * @author rvesse
- *
- * @param <TKey>
- * Key
- * @param <TValue>
- * Value
- */
-public class NullPlusValueReducer<TKey, TValue> extends Reducer<TKey, TValue, NullWritable, TValue> {
- private static final Logger LOGGER = LoggerFactory.getLogger(NullPlusValueReducer.class);
- private boolean tracing = false;
-
- @Override
- protected void setup(Context context) throws IOException, InterruptedException {
- super.setup(context);
- this.tracing = LOGGER.isTraceEnabled();
- }
-
- @Override
- protected void reduce(TKey key, Iterable<TValue> values, Context context) throws IOException, InterruptedException {
- if (this.tracing) {
- LOGGER.trace("Input Key = {}", key);
- }
- Iterator<TValue> iter = values.iterator();
- while (iter.hasNext()) {
- TValue value = iter.next();
- if (tracing) {
- LOGGER.trace("Input Value = {}", value);
- }
- context.write(NullWritable.get(), value);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/RdfMapReduceConstants.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/RdfMapReduceConstants.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/RdfMapReduceConstants.java
deleted file mode 100644
index 6a8cf18..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/RdfMapReduceConstants.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-/**
- * RDF Map/Reduce related constants
- *
- *
- *
- */
-public class RdfMapReduceConstants {
-
- /**
- * Private constructor prevents instantiation
- */
- private RdfMapReduceConstants() {
-
- }
-
- /**
- * Configuration key used to set whether the behaviour of the filter mappers
- * is inverted. When enabled the filter mappers will invert their selection
- * i.e. tuples that would normally be accepted will be rejected and vice
- * versa.
- */
- public static final String FILTER_INVERT = "rdf.mapreduce.filter.invert";
-
- /**
- * Configuration key used to set a command separated list of predicate URIs
- * to filter upon
- */
- public static final String FILTER_PREDICATE_URIS = "rdf.mapreduce.filter.predicate.uris";
-
- /**
- * Configuration key used to set a command separated list of subject URIs to
- * filter upon
- */
- public static final String FILTER_SUBJECT_URIS = "rdf.mapreduce.filter.subject.uris";
-
- /**
- * Configuration key used to set a command separated list of object URIs to
- * filter upon
- */
- public static final String FILTER_OBJECT_URIS = "rdf.mapreduce.filter.object.uris";
-
- /**
- * Configuration key used to set a command separated list of graph URIs to
- * filter upon
- */
- public static final String FILTER_GRAPH_URIS = "rdf.mapreduce.filter.graph.uris";
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/SwapMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/SwapMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/SwapMapper.java
deleted file mode 100644
index ef518a9..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/SwapMapper.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-
-import org.apache.hadoop.mapreduce.Mapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A mapper which swaps the key and value around
- *
- *
- * @param <TKey> Key type
- * @param <TValue> Value type
- */
-public class SwapMapper<TKey, TValue> extends Mapper<TKey, TValue, TValue, TKey> {
- private static final Logger LOG = LoggerFactory.getLogger(SwapMapper.class);
-
- private boolean tracing = false;
-
- @Override
- protected void setup(Context context) throws IOException, InterruptedException {
- super.setup(context);
- this.tracing = LOG.isTraceEnabled();
- }
-
- @Override
- protected void map(TKey key, TValue value, Context context) throws IOException,
- InterruptedException {
- if (this.tracing) {
- LOG.trace("Key = {}", key);
- LOG.trace("Value = {}", value);
- }
- context.write(value, key);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/SwapReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/SwapReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/SwapReducer.java
deleted file mode 100644
index e7e42a0..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/SwapReducer.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.apache.hadoop.mapreduce.Reducer;
-
-/**
- * A reducer that swaps the key and value
- * @author rvesse
- *
- * @param <TKey> Key
- * @param <TValue> Value
- */
-public class SwapReducer<TKey, TValue> extends Reducer<TKey, TValue, TValue, TKey> {
-
- @Override
- protected void reduce(TKey key, Iterable<TValue> values, Context context)
- throws IOException, InterruptedException {
- Iterator<TValue> iter = values.iterator();
- while (iter.hasNext()) {
- context.write(iter.next(), key);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/TextCountReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/TextCountReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/TextCountReducer.java
deleted file mode 100644
index 04b9283..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/TextCountReducer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.mapreduce.Reducer;
-
-/**
- * A reducer which takes text keys with a sequence of longs representing counts
- * as the values and sums the counts together into pairs consisting of a node
- * key and a count value.
- *
- *
- *
- */
-public class TextCountReducer extends Reducer<Text, LongWritable, Text, LongWritable> {
-
- @Override
- protected void reduce(Text key, Iterable<LongWritable> values, Context context) throws IOException,
- InterruptedException {
- long count = 0;
- Iterator<LongWritable> iter = values.iterator();
- while (iter.hasNext()) {
- count += iter.next().get();
- }
- context.write(key, new LongWritable(count));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValueMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValueMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValueMapper.java
deleted file mode 100644
index 23ae5f0..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValueMapper.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-
-import org.apache.hadoop.mapreduce.Mapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A mapper which discards the key replacing it with the value
- *
- *
- * @param <TKey> Key type
- * @param <TValue> Value type
- */
-public class ValueMapper<TKey, TValue> extends Mapper<TKey, TValue, TValue, TValue> {
- private static final Logger LOG = LoggerFactory.getLogger(ValueMapper.class);
-
- private boolean tracing = false;
-
- @Override
- protected void setup(Context context) throws IOException, InterruptedException {
- super.setup(context);
- this.tracing = LOG.isTraceEnabled();
- }
-
- @Override
- protected void map(TKey key, TValue value, Context context) throws IOException,
- InterruptedException {
- if (this.tracing) {
- LOG.trace("Value = {}", value);
- }
- context.write(value, value);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValuePlusNullMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValuePlusNullMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValuePlusNullMapper.java
deleted file mode 100644
index 094fb2d..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValuePlusNullMapper.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.Mapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A mapper which discards the key replacing it with the value and nulls out the value
- *
- *
- * @param <TKey> Key type
- * @param <TValue> Value type
- */
-public class ValuePlusNullMapper<TKey, TValue> extends Mapper<TKey, TValue, TValue, NullWritable> {
- private static final Logger LOG = LoggerFactory.getLogger(ValuePlusNullMapper.class);
-
- private boolean tracing = false;
-
- @Override
- protected void setup(Context context) throws IOException, InterruptedException {
- super.setup(context);
- this.tracing = LOG.isTraceEnabled();
- }
-
- @Override
- protected void map(TKey key, TValue value, Context context) throws IOException,
- InterruptedException {
- if (this.tracing) {
- LOG.trace("Value = {}", value);
- }
- context.write(value, NullWritable.get());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValueReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValueReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValueReducer.java
deleted file mode 100644
index 7d25799..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/ValueReducer.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.apache.hadoop.mapreduce.Reducer;
-
-/**
- * A reducer that outputs a pair for each value consisting of the value as both the key and value
- * @author rvesse
- *
- * @param <TKey> Key
- * @param <TValue> Value
- */
-public class ValueReducer<TKey, TValue> extends Reducer<TKey, TValue, TValue, TValue> {
-
- @Override
- protected void reduce(TKey key, Iterable<TValue> values, Context context)
- throws IOException, InterruptedException {
- Iterator<TValue> iter = values.iterator();
- while (iter.hasNext()) {
- TValue value = iter.next();
- context.write(value, value);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/AbstractCharacteristicSetGeneratingReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/AbstractCharacteristicSetGeneratingReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/AbstractCharacteristicSetGeneratingReducer.java
deleted file mode 100644
index daf61d4..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/AbstractCharacteristicSetGeneratingReducer.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.characteristics;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.Reducer;
-import org.apache.jena.hadoop.rdf.types.AbstractNodeTupleWritable;
-import org.apache.jena.hadoop.rdf.types.CharacteristicSetWritable;
-import org.apache.jena.hadoop.rdf.types.CharacteristicWritable;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Abstract reducer which takes in tuples grouped by some node and generating
- * initial characteristic sets.
- * <p>
- * This produces the characteristic sets as both the key and value so that in a
- * subsequent job the characteristic steps may be further combined together to
- * total up the usage counts appropriately.
- * </p>
- * <p>
- * It is important to note that the output from this mapper can be very large
- * and since it typically needs to be written to HDFS before being processed by
- * further jobs it is strongly recommended that you use appropriate output
- * compression
- * </p>
- *
- *
- *
- * @param <TValue>
- * Tuple type
- * @param <T>
- * Writable tuple type
- */
-public abstract class AbstractCharacteristicSetGeneratingReducer<TValue, T extends AbstractNodeTupleWritable<TValue>> extends
- Reducer<NodeWritable, T, CharacteristicSetWritable, NullWritable> {
-
- private static final Logger LOG = LoggerFactory.getLogger(AbstractCharacteristicSetGeneratingReducer.class);
-
- private boolean tracing = false;
-
- @Override
- protected void setup(Context context) throws IOException, InterruptedException {
- super.setup(context);
- this.tracing = LOG.isTraceEnabled();
- }
-
- @Override
- protected void reduce(NodeWritable key, Iterable<T> values, Context context) throws IOException, InterruptedException {
- Map<NodeWritable, CharacteristicWritable> characteristics = new TreeMap<NodeWritable, CharacteristicWritable>();
-
- // Firstly need to find individual characteristics
- Iterator<T> iter = values.iterator();
- while (iter.hasNext()) {
- T tuple = iter.next();
- NodeWritable predicate = this.getPredicate(tuple);
-
- if (characteristics.containsKey(predicate)) {
- characteristics.get(predicate).increment();
- } else {
- characteristics.put(predicate, new CharacteristicWritable(predicate.get()));
- }
- }
-
- // Then we need to produce all the possible characteristic sets based on
- // this information
- List<CharacteristicWritable> cs = new ArrayList<CharacteristicWritable>(characteristics.values());
- if (cs.size() == 0)
- return;
- for (int i = 1; i <= cs.size(); i++) {
- this.outputSets(cs, i, context);
- }
- }
-
- /**
- * Output all sets of a given size
- *
- * @param cs
- * Characteristics
- * @param perSet
- * Set size
- * @param context
- * Context to output sets to
- * @throws IOException
- * @throws InterruptedException
- */
- protected void outputSets(List<CharacteristicWritable> cs, int perSet, Context context) throws IOException,
- InterruptedException {
- if (perSet == 1) {
- for (CharacteristicWritable c : cs) {
- CharacteristicSetWritable set = new CharacteristicSetWritable(c);
- context.write(set, NullWritable.get());
- if (this.tracing) {
- LOG.trace("Key = {}", set);
- }
- }
- } else if (perSet == cs.size()) {
- CharacteristicSetWritable set = new CharacteristicSetWritable();
- for (CharacteristicWritable c : cs) {
- set.add(c);
- }
- context.write(set, NullWritable.get());
- if (this.tracing) {
- LOG.trace("Key = {}", set);
- }
- } else {
- CharacteristicWritable[] members = new CharacteristicWritable[perSet];
- this.combinations(cs, perSet, 0, members, context);
- }
- }
-
- /**
- * Calculate all available combinations of N elements from the given
- * characteristics
- *
- * @param cs
- * Characteristics
- * @param len
- * Desired number of elements
- * @param startPosition
- * Start position
- * @param result
- * Result array to fill
- * @param context
- * Context to write completed combinations to
- * @throws IOException
- * @throws InterruptedException
- */
- protected final void combinations(List<CharacteristicWritable> cs, int len, int startPosition,
- CharacteristicWritable[] result, Context context) throws IOException, InterruptedException {
- if (len == 0) {
- CharacteristicSetWritable set = new CharacteristicSetWritable(result);
- context.write(set, NullWritable.get());
- if (this.tracing) {
- LOG.trace("Key = {}", set);
- }
- return;
- }
- for (int i = startPosition; i <= cs.size() - len; i++) {
- result[result.length - len] = cs.get(i);
- combinations(cs, len - 1, i + 1, result, context);
- }
- }
-
- /**
- * Gets the predicate for the tuple
- *
- * @param tuple
- * Tuple
- * @return
- */
- protected abstract NodeWritable getPredicate(T tuple);
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/CharacteristicSetReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/CharacteristicSetReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/CharacteristicSetReducer.java
deleted file mode 100644
index e70698a..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/CharacteristicSetReducer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.characteristics;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.Reducer;
-import org.apache.jena.hadoop.rdf.types.CharacteristicSetWritable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Reducer which takes in characteristic sets and sums up all their usage counts
- *
- *
- */
-public class CharacteristicSetReducer extends
- Reducer<CharacteristicSetWritable, CharacteristicSetWritable, CharacteristicSetWritable, NullWritable> {
-
- private static final Logger LOG = LoggerFactory.getLogger(CharacteristicSetReducer.class);
- private boolean tracing = false;
-
- @Override
- protected void setup(Context context) throws IOException, InterruptedException {
- super.setup(context);
- this.tracing = LOG.isTraceEnabled();
- }
-
- @Override
- protected void reduce(CharacteristicSetWritable key, Iterable<CharacteristicSetWritable> values, Context context)
- throws IOException, InterruptedException {
- Iterator<CharacteristicSetWritable> iter = values.iterator();
- CharacteristicSetWritable output = new CharacteristicSetWritable(0);
-
- if (this.tracing) {
- LOG.trace("Key = {}", key);
- }
-
- while (iter.hasNext()) {
- CharacteristicSetWritable set = iter.next();
- if (this.tracing) {
- LOG.trace("Value = {}", set);
- }
- output.add(set);
- }
-
- context.write(output, NullWritable.get());
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/QuadCharacteristicSetGeneratingReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/QuadCharacteristicSetGeneratingReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/QuadCharacteristicSetGeneratingReducer.java
deleted file mode 100644
index d11cd56..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/QuadCharacteristicSetGeneratingReducer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.characteristics;
-
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-
-import com.hp.hpl.jena.sparql.core.Quad;
-
-/**
- * A reducer which converts quads grouped by some node into characteristic sets
- *
- *
- *
- */
-public class QuadCharacteristicSetGeneratingReducer extends AbstractCharacteristicSetGeneratingReducer<Quad, QuadWritable> {
-
- @Override
- protected NodeWritable getPredicate(QuadWritable tuple) {
- return new NodeWritable(tuple.get().getPredicate());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/TripleCharacteristicSetGeneratingReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/TripleCharacteristicSetGeneratingReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/TripleCharacteristicSetGeneratingReducer.java
deleted file mode 100644
index 6515c91..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/characteristics/TripleCharacteristicSetGeneratingReducer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.characteristics;
-
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-import com.hp.hpl.jena.graph.Triple;
-
-/**
- * A reducer which converts triples grouped by some node into characteristic
- * sets
- *
- *
- *
- */
-public class TripleCharacteristicSetGeneratingReducer extends AbstractCharacteristicSetGeneratingReducer<Triple, TripleWritable> {
-
- @Override
- protected NodeWritable getPredicate(TripleWritable tuple) {
- return new NodeWritable(tuple.get().getPredicate());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/AbstractNodeTupleNodeCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/AbstractNodeTupleNodeCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/AbstractNodeTupleNodeCountMapper.java
deleted file mode 100644
index 7c56d1c..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/AbstractNodeTupleNodeCountMapper.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.mapreduce.Mapper;
-import org.apache.jena.hadoop.rdf.types.AbstractNodeTupleWritable;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-
-
-/**
- * Abstract mapper class for mappers which split node tuple values into pairs of
- * node keys with a long value of 1. Can be used in conjunction with a
- * {@link NodeCountReducer} to count the usages of each unique node.
- *
- *
- *
- * @param <TKey>
- * Key type
- * @param <TValue>
- * Tuple type
- * @param <T>
- * Writable tuple type
- */
-public abstract class AbstractNodeTupleNodeCountMapper<TKey, TValue, T extends AbstractNodeTupleWritable<TValue>> extends
- Mapper<TKey, T, NodeWritable, LongWritable> {
-
- private LongWritable initialCount = new LongWritable(1);
-
- @Override
- protected void map(TKey key, T value, Context context) throws IOException,
- InterruptedException {
- NodeWritable[] ns = this.getNodes(value);
- for (NodeWritable n : ns) {
- context.write(n, this.initialCount);
- }
- }
-
- /**
- * Gets the nodes of the tuple which are to be counted
- *
- * @param tuple
- * Tuple
- * @return Nodes
- */
- protected abstract NodeWritable[] getNodes(T tuple);
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/NodeCountReducer.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/NodeCountReducer.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/NodeCountReducer.java
deleted file mode 100644
index a5460f6..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/NodeCountReducer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.mapreduce.Reducer;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-
-
-/**
- * A reducer which takes node keys with a sequence of longs representing counts
- * as the values and sums the counts together into pairs consisting of a node
- * key and a count value.
- *
- *
- *
- */
-public class NodeCountReducer extends Reducer<NodeWritable, LongWritable, NodeWritable, LongWritable> {
-
- @Override
- protected void reduce(NodeWritable key, Iterable<LongWritable> values, Context context) throws IOException,
- InterruptedException {
- long count = 0;
- Iterator<LongWritable> iter = values.iterator();
- while (iter.hasNext()) {
- count += iter.next().get();
- }
- context.write(key, new LongWritable(count));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/QuadNodeCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/QuadNodeCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/QuadNodeCountMapper.java
deleted file mode 100644
index 5c2485b..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/QuadNodeCountMapper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count;
-
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-
-import com.hp.hpl.jena.sparql.core.Quad;
-
-/**
- * A mapper for counting node usages within quads designed primarily for use in
- * conjunction with {@link NodeCountReducer}
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class QuadNodeCountMapper<TKey> extends AbstractNodeTupleNodeCountMapper<TKey, Quad, QuadWritable> {
-
- @Override
- protected NodeWritable[] getNodes(QuadWritable tuple) {
- Quad q = tuple.get();
- return new NodeWritable[] { new NodeWritable(q.getGraph()), new NodeWritable(q.getSubject()),
- new NodeWritable(q.getPredicate()), new NodeWritable(q.getObject()) };
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/TripleNodeCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/TripleNodeCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/TripleNodeCountMapper.java
deleted file mode 100644
index 4108841..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/TripleNodeCountMapper.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count;
-
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-import com.hp.hpl.jena.graph.Triple;
-
-/**
- * A mapper for counting node usages within triples designed primarily for use
- * in conjunction with {@link NodeCountReducer}
- *
- *
- *
- * @param <TKey> Key type
- */
-public class TripleNodeCountMapper<TKey> extends AbstractNodeTupleNodeCountMapper<TKey, Triple, TripleWritable> {
-
- @Override
- protected NodeWritable[] getNodes(TripleWritable tuple) {
- Triple t = tuple.get();
- return new NodeWritable[] { new NodeWritable(t.getSubject()), new NodeWritable(t.getPredicate()),
- new NodeWritable(t.getObject()) };
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/datatypes/QuadDataTypeCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/datatypes/QuadDataTypeCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/datatypes/QuadDataTypeCountMapper.java
deleted file mode 100644
index 7ea7ead..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/datatypes/QuadDataTypeCountMapper.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.datatypes;
-
-import org.apache.jena.hadoop.rdf.mapreduce.count.NodeCountReducer;
-import org.apache.jena.hadoop.rdf.mapreduce.count.QuadNodeCountMapper;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-
-import com.hp.hpl.jena.graph.Node;
-import com.hp.hpl.jena.graph.NodeFactory;
-
-/**
- * A mapper for counting data type usages within quads designed primarily for
- * use in conjunction with {@link NodeCountReducer}
- * <p>
- * This mapper extracts the data types for typed literal objects and converts
- * them into nodes so they can be counted
- * </p>
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class QuadDataTypeCountMapper<TKey> extends QuadNodeCountMapper<TKey> {
-
- private static final NodeWritable[] EMPTY = new NodeWritable[0];
-
- @Override
- protected NodeWritable[] getNodes(QuadWritable tuple) {
- Node object = tuple.get().getObject();
- if (!object.isLiteral())
- return EMPTY;
- String dtUri = object.getLiteralDatatypeURI();
- if (dtUri == null)
- return EMPTY;
- return new NodeWritable[] { new NodeWritable(NodeFactory.createURI(dtUri)) };
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/datatypes/TripleDataTypeCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/datatypes/TripleDataTypeCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/datatypes/TripleDataTypeCountMapper.java
deleted file mode 100644
index 2c294be..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/datatypes/TripleDataTypeCountMapper.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.datatypes;
-
-import org.apache.jena.hadoop.rdf.mapreduce.count.NodeCountReducer;
-import org.apache.jena.hadoop.rdf.mapreduce.count.TripleNodeCountMapper;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-import com.hp.hpl.jena.graph.Node;
-import com.hp.hpl.jena.graph.NodeFactory;
-
-/**
- * A mapper for counting data type usages within triples designed primarily for
- * use in conjunction with {@link NodeCountReducer}
- * <p>
- * This mapper extracts the data types for typed literal objects and converts
- * them into nodes so they can be counted
- * </p>
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class TripleDataTypeCountMapper<TKey> extends TripleNodeCountMapper<TKey> {
-
- private static final NodeWritable[] EMPTY = new NodeWritable[0];
-
- @Override
- protected NodeWritable[] getNodes(TripleWritable tuple) {
- Node object = tuple.get().getObject();
- if (!object.isLiteral())
- return EMPTY;
- String dtUri = object.getLiteralDatatypeURI();
- if (dtUri == null)
- return EMPTY;
- return new NodeWritable[] { new NodeWritable(NodeFactory.createURI(dtUri)) };
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/AbstractNodeTupleNamespaceCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/AbstractNodeTupleNamespaceCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/AbstractNodeTupleNamespaceCountMapper.java
deleted file mode 100644
index ba47765..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/AbstractNodeTupleNamespaceCountMapper.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.namespaces;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.mapreduce.Mapper;
-import org.apache.jena.hadoop.rdf.mapreduce.TextCountReducer;
-import org.apache.jena.hadoop.rdf.types.AbstractNodeTupleWritable;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-
-import com.hp.hpl.jena.graph.Node;
-
-/**
- * Abstract mapper class for mappers which split node tuple values and extract
- * the namespace URIs they use and outputs pairs of namespaces keys with a long
- * value of 1. Can be used in conjunction with a {@link TextCountReducer} to
- * count the usages of each unique namespace.
- *
- *
- *
- * @param <TKey>
- * @param <TValue>
- * @param <T>
- */
-public abstract class AbstractNodeTupleNamespaceCountMapper<TKey, TValue, T extends AbstractNodeTupleWritable<TValue>> extends
- Mapper<TKey, T, Text, LongWritable> {
-
- private LongWritable initialCount = new LongWritable(1);
- protected static final String NO_NAMESPACE = null;
-
- @Override
- protected void map(TKey key, T value, Context context) throws IOException, InterruptedException {
- NodeWritable[] ns = this.getNodes(value);
- for (NodeWritable n : ns) {
- String namespace = this.extractNamespace(n);
- if (namespace != null) {
- context.write(new Text(namespace), this.initialCount);
- }
- }
- }
-
- /**
- * Extracts the namespace from a node
- * <p>
- * Finds the URI for the node (if any) and then invokes
- * {@link #extractNamespace(String)} to extract the actual namespace URI.
- * </p>
- * <p>
- * Derived classes may override this to change the logic of how namespaces
- * are extracted.
- * </p>
- *
- * @param nw
- * Node
- * @return Namespace
- */
- protected String extractNamespace(NodeWritable nw) {
- Node n = nw.get();
- if (n.isBlank() || n.isVariable())
- return NO_NAMESPACE;
- if (n.isLiteral()) {
- String dtUri = n.getLiteralDatatypeURI();
- if (dtUri == null)
- return NO_NAMESPACE;
- return extractNamespace(dtUri);
- }
- return extractNamespace(n.getURI());
- }
-
- /**
- * Extracts the namespace from a URI
- * <p>
- * First tries to extract a hash based namespace. If that is not possible it
- * tries to extract a slash based namespace, if this is not possible then
- * the full URI is returned.
- * </p>
- * <p>
- * Derived classes may override this to change the logic of how namespaces
- * are extracted.
- * </p>
- *
- * @param uri
- * URI
- * @return Namespace
- */
- protected String extractNamespace(String uri) {
- if (uri.contains("#")) {
- // Extract hash namespace
- return uri.substring(0, uri.lastIndexOf('#') + 1);
- } else if (uri.contains("/")) {
- // Ensure that this is not immediately after the scheme component or
- // at end of URI
- int index = uri.lastIndexOf('/');
- int schemeSepIndex = uri.indexOf(':');
- if (index - schemeSepIndex <= 2 || index == uri.length() - 1) {
- // Use full URI
- return uri;
- }
-
- // Otherwise safe to extract slash namespace
- return uri.substring(0, uri.lastIndexOf('/') + 1);
- } else {
- // Use full URI
- return uri;
- }
- }
-
- /**
- * Gets the nodes of the tuple whose namespaces are to be counted
- *
- * @param tuple
- * Tuple
- * @return Nodes
- */
- protected abstract NodeWritable[] getNodes(T tuple);
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/QuadNamespaceCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/QuadNamespaceCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/QuadNamespaceCountMapper.java
deleted file mode 100644
index 97ee546..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/QuadNamespaceCountMapper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.namespaces;
-
-import org.apache.jena.hadoop.rdf.mapreduce.TextCountReducer;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-
-import com.hp.hpl.jena.sparql.core.Quad;
-
-/**
- * A mapper for counting namespace usages within quads designed primarily for
- * use in conjunction with the {@link TextCountReducer}
- *
- *
- *
- * @param <TKey>
- */
-public class QuadNamespaceCountMapper<TKey> extends AbstractNodeTupleNamespaceCountMapper<TKey, Quad, QuadWritable> {
-
- @Override
- protected NodeWritable[] getNodes(QuadWritable tuple) {
- Quad q = tuple.get();
- return new NodeWritable[] { new NodeWritable(q.getGraph()), new NodeWritable(q.getSubject()),
- new NodeWritable(q.getPredicate()), new NodeWritable(q.getObject()) };
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/TripleNamespaceCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/TripleNamespaceCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/TripleNamespaceCountMapper.java
deleted file mode 100644
index eacef7a..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/namespaces/TripleNamespaceCountMapper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.namespaces;
-
-import org.apache.jena.hadoop.rdf.mapreduce.TextCountReducer;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-import com.hp.hpl.jena.graph.Triple;
-
-/**
- * A mapper for counting namespace usages within triples designed primarily for
- * use in conjunction with the {@link TextCountReducer}
- *
- *
- *
- * @param <TKey>
- */
-public class TripleNamespaceCountMapper<TKey> extends AbstractNodeTupleNamespaceCountMapper<TKey, Triple, TripleWritable> {
-
- @Override
- protected NodeWritable[] getNodes(TripleWritable tuple) {
- Triple t = tuple.get();
- return new NodeWritable[] { new NodeWritable(t.getSubject()), new NodeWritable(t.getPredicate()),
- new NodeWritable(t.getObject()) };
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadObjectCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadObjectCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadObjectCountMapper.java
deleted file mode 100644
index ef19623..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadObjectCountMapper.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.positional;
-
-import org.apache.jena.hadoop.rdf.mapreduce.count.NodeCountReducer;
-import org.apache.jena.hadoop.rdf.mapreduce.count.QuadNodeCountMapper;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-
-
-/**
- * A mapper for counting object node usages within quads designed primarily for
- * use in conjunction with {@link NodeCountReducer}
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class QuadObjectCountMapper<TKey> extends QuadNodeCountMapper<TKey> {
-
- @Override
- protected NodeWritable[] getNodes(QuadWritable tuple) {
- return new NodeWritable[] { new NodeWritable(tuple.get().getObject()) };
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadPredicateCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadPredicateCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadPredicateCountMapper.java
deleted file mode 100644
index 0ef0731..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadPredicateCountMapper.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.positional;
-
-import org.apache.jena.hadoop.rdf.mapreduce.count.NodeCountReducer;
-import org.apache.jena.hadoop.rdf.mapreduce.count.QuadNodeCountMapper;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-
-
-/**
- * A mapper for counting predicate node usages within quads designed primarily
- * for use in conjunction with {@link NodeCountReducer}
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class QuadPredicateCountMapper<TKey> extends QuadNodeCountMapper<TKey> {
-
- @Override
- protected NodeWritable[] getNodes(QuadWritable tuple) {
- return new NodeWritable[] { new NodeWritable(tuple.get().getPredicate()) };
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadSubjectCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadSubjectCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadSubjectCountMapper.java
deleted file mode 100644
index 2b48e79..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/QuadSubjectCountMapper.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.positional;
-
-import org.apache.jena.hadoop.rdf.mapreduce.count.NodeCountReducer;
-import org.apache.jena.hadoop.rdf.mapreduce.count.QuadNodeCountMapper;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-
-
-/**
- * A mapper for counting subject node usages within quads designed primarily for use
- * in conjunction with {@link NodeCountReducer}
- *
- *
- *
- * @param <TKey> Key type
- */
-public class QuadSubjectCountMapper<TKey> extends QuadNodeCountMapper<TKey> {
-
- @Override
- protected NodeWritable[] getNodes(QuadWritable tuple) {
- return new NodeWritable[] { new NodeWritable(tuple.get().getSubject()) };
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TripleObjectCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TripleObjectCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TripleObjectCountMapper.java
deleted file mode 100644
index 16250eb..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TripleObjectCountMapper.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.positional;
-
-import org.apache.jena.hadoop.rdf.mapreduce.count.NodeCountReducer;
-import org.apache.jena.hadoop.rdf.mapreduce.count.TripleNodeCountMapper;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-
-/**
- * A mapper for counting object node usages within triples designed primarily for use
- * in conjunction with {@link NodeCountReducer}
- *
- *
- *
- * @param <TKey> Key type
- */
-public class TripleObjectCountMapper<TKey> extends TripleNodeCountMapper<TKey> {
-
- @Override
- protected NodeWritable[] getNodes(TripleWritable tuple) {
- return new NodeWritable[] { new NodeWritable(tuple.get().getObject()) };
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TriplePredicateCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TriplePredicateCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TriplePredicateCountMapper.java
deleted file mode 100644
index de97a9b..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TriplePredicateCountMapper.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.positional;
-
-import org.apache.jena.hadoop.rdf.mapreduce.count.NodeCountReducer;
-import org.apache.jena.hadoop.rdf.mapreduce.count.TripleNodeCountMapper;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-
-/**
- * A mapper for counting predicate node usages within triples designed primarily
- * for use in conjunction with {@link NodeCountReducer}
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class TriplePredicateCountMapper<TKey> extends TripleNodeCountMapper<TKey> {
-
- @Override
- protected NodeWritable[] getNodes(TripleWritable tuple) {
- return new NodeWritable[] { new NodeWritable(tuple.get().getPredicate()) };
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TripleSubjectCountMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TripleSubjectCountMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TripleSubjectCountMapper.java
deleted file mode 100644
index 5dc3838..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/count/positional/TripleSubjectCountMapper.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.count.positional;
-
-import org.apache.jena.hadoop.rdf.mapreduce.count.NodeCountReducer;
-import org.apache.jena.hadoop.rdf.mapreduce.count.TripleNodeCountMapper;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-
-/**
- * A mapper for counting subject node usages within triples designed primarily for use
- * in conjunction with {@link NodeCountReducer}
- *
- *
- *
- * @param <TKey> Key type
- */
-public class TripleSubjectCountMapper<TKey> extends TripleNodeCountMapper<TKey> {
-
- @Override
- protected NodeWritable[] getNodes(TripleWritable tuple) {
- return new NodeWritable[] { new NodeWritable(tuple.get().getSubject()) };
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/05c389be/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/filter/AbstractNodeTupleFilterMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/filter/AbstractNodeTupleFilterMapper.java b/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/filter/AbstractNodeTupleFilterMapper.java
deleted file mode 100644
index 1ecec75..0000000
--- a/hadoop-rdf-mapreduce/src/main/java/org/apache/jena/hadoop/rdf/mapreduce/filter/AbstractNodeTupleFilterMapper.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.jena.hadoop.rdf.mapreduce.filter;
-
-import java.io.IOException;
-
-import org.apache.hadoop.mapreduce.Mapper;
-import org.apache.jena.hadoop.rdf.mapreduce.RdfMapReduceConstants;
-import org.apache.jena.hadoop.rdf.types.AbstractNodeTupleWritable;
-
-
-/**
- * Abstract mapper implementation which helps in filtering tuples from the
- * input, derived implementations provide an implementation of the
- * {@link #accepts(TKey, T)}
- *
- *
- *
- * @param <TKey>
- * Key type
- * @param <TValue>
- * Tuple type
- * @param <T>
- * Writable tuple type
- */
-@SuppressWarnings("javadoc")
-public abstract class AbstractNodeTupleFilterMapper<TKey, TValue, T extends AbstractNodeTupleWritable<TValue>> extends
- Mapper<TKey, T, TKey, T> {
-
- private boolean invert = false;
-
- @Override
- protected void setup(Context context) throws IOException, InterruptedException {
- super.setup(context);
- this.invert = context.getConfiguration().getBoolean(RdfMapReduceConstants.FILTER_INVERT, this.invert);
- }
-
- @Override
- protected final void map(TKey key, T value, Context context) throws IOException, InterruptedException {
- if (this.accepts(key, value)) {
- if (!this.invert)
- context.write(key, value);
- } else if (this.invert) {
- context.write(key, value);
- }
- }
-
- /**
- * Gets whether the mapper accepts the key value pair and will pass it as
- * output
- *
- * @param key
- * Key
- * @param tuple
- * Tuple value
- * @return True if the mapper accepts the given key value pair, false
- * otherwise
- */
- protected abstract boolean accepts(TKey key, T tuple);
-}