fluent API moved into commons-rdf-api/
Project: http://git-wip-us.apache.org/repos/asf/commons-rdf/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-rdf/commit/96fb0f06 Tree: http://git-wip-us.apache.org/repos/asf/commons-rdf/tree/96fb0f06 Diff: http://git-wip-us.apache.org/repos/asf/commons-rdf/diff/96fb0f06 Branch: refs/heads/fluent-parser Commit: 96fb0f06b58add16869637e5ab18ac5d7dbd1be0 Parents: 577614d Author: Stian Soiland-Reyes <st...@apache.org> Authored: Wed Feb 14 19:03:08 2018 +0000 Committer: Stian Soiland-Reyes <st...@apache.org> Committed: Wed Feb 14 19:03:08 2018 +0000 ---------------------------------------------------------------------- .../commons/rdf/api/fluentparser/Async.java | 31 ----- .../rdf/api/fluentparser/NeedSourceBased.java | 29 ----- .../rdf/api/fluentparser/NeedSourceOrBase.java | 25 ---- .../rdf/api/fluentparser/NeedTarget.java | 25 ---- .../rdf/api/fluentparser/NeedTargetOrRDF.java | 25 ---- .../fluentparser/NeedTargetOrRDFOrSyntax.java | 22 ---- .../rdf/api/fluentparser/OptionalTarget.java | 25 ---- .../fluentparser/OptionalTargetOrSyntax.java | 5 - .../commons/rdf/api/fluentparser/Sync.java | 32 ----- .../rdf/api/fluentparser/_Buildable.java | 50 ------- .../api/fluentparser/_NeedIdentifiedSource.java | 35 ----- .../rdf/api/fluentparser/_NeedSyntax.java | 7 - .../rdf/api/fluentparser/_NeedTarget.java | 30 ----- .../rdf/api/fluentparser/_NeedTargetOrRDF.java | 21 --- .../rdf/api/fluentparser/_OptionalBase.java | 26 ---- .../rdf/api/fluentparser/_OptionalRDF.java | 25 ---- .../rdf/api/fluentparser/package-info.java | 21 --- .../commons/rdf/api/fluentwriter/Async.java | 14 -- .../rdf/api/fluentwriter/NeedSource.java | 20 --- .../rdf/api/fluentwriter/NeedTarget.java | 34 ----- .../commons/rdf/api/fluentwriter/Sync.java | 16 --- .../rdf/api/fluentwriter/_Buildable.java | 50 ------- .../rdf/api/fluentwriter/package-info.java | 21 --- .../org/apache/commons/rdf/api/io/Option.java | 25 ---- .../org/apache/commons/rdf/api/io/Parsed.java | 26 ---- .../commons/rdf/api/io/ParserBuilder.java | 9 -- .../commons/rdf/api/io/ParserFactory.java | 27 ---- .../apache/commons/rdf/api/io/ParserSource.java | 33 ----- .../apache/commons/rdf/api/io/ParserTarget.java | 32 ----- .../commons/rdf/api/io/WriterFactory.java | 25 ---- .../apache/commons/rdf/api/io/WriterSource.java | 9 -- .../apache/commons/rdf/api/io/WriterTarget.java | 8 -- .../org/apache/commons/rdf/api/io/Written.java | 9 -- .../commons/rdf/api/io/_SupportedSyntaxes.java | 28 ---- .../apache/commons/rdf/api/io/package-info.java | 21 --- .../apache/commons/rdf/experimental/Test.java | 130 ------------------- .../commons/rdf/api/fluentparser/Async.java | 31 +++++ .../rdf/api/fluentparser/NeedSourceBased.java | 29 +++++ .../rdf/api/fluentparser/NeedSourceOrBase.java | 25 ++++ .../rdf/api/fluentparser/NeedTarget.java | 25 ++++ .../rdf/api/fluentparser/NeedTargetOrRDF.java | 25 ++++ .../fluentparser/NeedTargetOrRDFOrSyntax.java | 22 ++++ .../rdf/api/fluentparser/OptionalTarget.java | 25 ++++ .../fluentparser/OptionalTargetOrSyntax.java | 5 + .../commons/rdf/api/fluentparser/Sync.java | 32 +++++ .../rdf/api/fluentparser/_Buildable.java | 50 +++++++ .../api/fluentparser/_NeedIdentifiedSource.java | 35 +++++ .../rdf/api/fluentparser/_NeedSyntax.java | 7 + .../rdf/api/fluentparser/_NeedTarget.java | 30 +++++ .../rdf/api/fluentparser/_NeedTargetOrRDF.java | 21 +++ .../rdf/api/fluentparser/_OptionalBase.java | 26 ++++ .../rdf/api/fluentparser/_OptionalRDF.java | 25 ++++ .../rdf/api/fluentparser/package-info.java | 21 +++ .../commons/rdf/api/fluentwriter/Async.java | 14 ++ .../rdf/api/fluentwriter/NeedSource.java | 20 +++ .../rdf/api/fluentwriter/NeedTarget.java | 34 +++++ .../commons/rdf/api/fluentwriter/Sync.java | 16 +++ .../rdf/api/fluentwriter/_Buildable.java | 50 +++++++ .../rdf/api/fluentwriter/package-info.java | 21 +++ .../org/apache/commons/rdf/api/io/Option.java | 25 ++++ .../org/apache/commons/rdf/api/io/Parsed.java | 26 ++++ .../commons/rdf/api/io/ParserBuilder.java | 9 ++ .../commons/rdf/api/io/ParserFactory.java | 27 ++++ .../apache/commons/rdf/api/io/ParserSource.java | 33 +++++ .../apache/commons/rdf/api/io/ParserTarget.java | 32 +++++ .../commons/rdf/api/io/WriterFactory.java | 25 ++++ .../apache/commons/rdf/api/io/WriterSource.java | 9 ++ .../apache/commons/rdf/api/io/WriterTarget.java | 8 ++ .../org/apache/commons/rdf/api/io/Written.java | 9 ++ .../commons/rdf/api/io/_SupportedSyntaxes.java | 28 ++++ .../apache/commons/rdf/api/io/package-info.java | 21 +++ 71 files changed, 841 insertions(+), 971 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java deleted file mode 100644 index ba3fb2d..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java +++ /dev/null @@ -1,31 +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.commons.rdf.api.fluentparser; - -import java.util.concurrent.Future; - -import org.apache.commons.rdf.api.io.Option; -import org.apache.commons.rdf.api.io.Parsed; - -public interface Async<T, S> extends _Buildable { - Async<T, S> build(); - - <V> Async<T, S> option(Option<V> option, V value); - - Future<Parsed<T, S>> parseAsync(); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java deleted file mode 100644 index 54889e1..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java +++ /dev/null @@ -1,29 +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.commons.rdf.api.fluentparser; - -import java.io.InputStream; - -import org.apache.commons.rdf.api.io.Option; - -public interface NeedSourceBased<T> extends _NeedIdentifiedSource<T>, _Buildable { - NeedSourceBased<T> build(); - <V> NeedSourceBased<T> option(Option<V> option, V value); - - Sync<T, InputStream> source(InputStream is); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java deleted file mode 100644 index 91b83b7..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java +++ /dev/null @@ -1,25 +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.commons.rdf.api.fluentparser; - -import org.apache.commons.rdf.api.io.Option; - -public interface NeedSourceOrBase<T> extends _OptionalBase<T>, _NeedIdentifiedSource<T>, _Buildable { - NeedSourceOrBase<T> build(); - <V> NeedSourceOrBase<T> option(Option<V> option, V value); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java deleted file mode 100644 index 4ed3849..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java +++ /dev/null @@ -1,25 +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.commons.rdf.api.fluentparser; - -import org.apache.commons.rdf.api.io.Option; - -interface NeedTarget extends _NeedTarget,_Buildable { - NeedTarget build(); - <V> NeedTarget option(Option<V> option, V value); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java deleted file mode 100644 index 109b70d..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java +++ /dev/null @@ -1,25 +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.commons.rdf.api.fluentparser; - -import org.apache.commons.rdf.api.io.Option; - -public interface NeedTargetOrRDF extends _NeedTargetOrRDF,_Buildable { - NeedTargetOrRDF build(); - <V> NeedTargetOrRDF option(Option<V> option, V value); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDFOrSyntax.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDFOrSyntax.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDFOrSyntax.java deleted file mode 100644 index 61a0256..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDFOrSyntax.java +++ /dev/null @@ -1,22 +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.commons.rdf.api.fluentparser; - -public interface NeedTargetOrRDFOrSyntax extends _NeedTargetOrRDF, _NeedSyntax { - -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java deleted file mode 100644 index be8195c..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java +++ /dev/null @@ -1,25 +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.commons.rdf.api.fluentparser; - -import org.apache.commons.rdf.api.io.Option; - -public interface OptionalTarget<T> extends _NeedTarget, NeedSourceOrBase<T>,_Buildable { - OptionalTarget<T> build(); - <V> OptionalTarget<T> option(Option<V> option, V value); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java deleted file mode 100644 index 7dee7e4..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.apache.commons.rdf.api.fluentparser; - -public interface OptionalTargetOrSyntax<T> extends OptionalTarget<T>, _NeedSyntax { - -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java deleted file mode 100644 index c141a18..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java +++ /dev/null @@ -1,32 +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.commons.rdf.api.fluentparser; - -import java.util.concurrent.ExecutorService; - -import org.apache.commons.rdf.api.io.Option; -import org.apache.commons.rdf.api.io.Parsed; - -public interface Sync<T, S> extends _Buildable{ - Sync<T ,S> build(); - <V> Sync<T, S> option(Option<V> option, V value); - - Async<T, S> async(); - Async<T, S> async(ExecutorService executor); - Parsed<T, S> parse(); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java deleted file mode 100644 index b21eb9d..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.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.commons.rdf.api.fluentparser; - -import org.apache.commons.rdf.api.io.Option; -import org.apache.commons.rdf.api.io.Option.RequiredOption; -import org.apache.commons.rdf.api.io.ParserFactory; - -interface _Buildable { - /** - * Return an immutable builder at the current state. The returned builder - * can be re-used multiple times in a thread-safe way. - * - * @return An immutable builder - */ - _Buildable build(); - - /** - * Return a builder with the given option set. - * <p> - * Note that implementations of {@link ParserFactory} may support different - * vendor-specific {@link Option} types, and are free to ignore the set - * option (unless it is a {@link RequiredOption}). - * <p> - * It is undefined if setting multiple values for the same (equal) option - * are accumulative or overriding. - * - * @param <V> The type of the {@link Option} value - * @param option Option to set - * @param value Value to set for option - * @return A builder with the given option set - */ - <V> _Buildable option(Option<V> option, V value); - -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java deleted file mode 100644 index 580adf6..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java +++ /dev/null @@ -1,35 +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.commons.rdf.api.fluentparser; - -import java.nio.file.Path; - -import javax.xml.transform.Source; - -import org.apache.commons.rdf.api.IRI; -import org.apache.commons.rdf.api.io.ParserSource; - -interface _NeedIdentifiedSource<T> { - Sync<T, IRI> source(IRI iri); - - Sync<T, Path> source(Path path); - - <S> Sync<T, S> source(ParserSource<S> source); - - Sync<T, IRI> source(String iri); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java deleted file mode 100644 index 28f0cd1..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.apache.commons.rdf.api.fluentparser; - -import org.apache.commons.rdf.api.RDFSyntax; - -interface _NeedSyntax { - NeedTargetOrRDF syntax(RDFSyntax syntax); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTarget.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTarget.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTarget.java deleted file mode 100644 index 2053f3b..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTarget.java +++ /dev/null @@ -1,30 +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.commons.rdf.api.fluentparser; - -import org.apache.commons.rdf.api.Dataset; -import org.apache.commons.rdf.api.Graph; -import org.apache.commons.rdf.api.io.ParserTarget; - -interface _NeedTarget { - NeedSourceOrBase<Dataset> target(Dataset dataset); - - NeedSourceOrBase<Graph> target(Graph graph); - - <T> NeedSourceOrBase<T> target(ParserTarget<T> target); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTargetOrRDF.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTargetOrRDF.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTargetOrRDF.java deleted file mode 100644 index 89016b4..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTargetOrRDF.java +++ /dev/null @@ -1,21 +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.commons.rdf.api.fluentparser; - -interface _NeedTargetOrRDF extends _NeedTarget, _OptionalRDF { -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalBase.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalBase.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalBase.java deleted file mode 100644 index 3e3235c..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalBase.java +++ /dev/null @@ -1,26 +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.commons.rdf.api.fluentparser; - -import org.apache.commons.rdf.api.IRI; - -interface _OptionalBase<T> { - NeedSourceBased<T> base(IRI iri); - - NeedSourceBased<T> base(String iri); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalRDF.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalRDF.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalRDF.java deleted file mode 100644 index 80ac15b..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalRDF.java +++ /dev/null @@ -1,25 +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.commons.rdf.api.fluentparser; - -import org.apache.commons.rdf.api.Dataset; -import org.apache.commons.rdf.api.RDF; - -interface _OptionalRDF { - OptionalTarget<Dataset> rdf(RDF rdf); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentparser/package-info.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/package-info.java b/api/src/main/java/org/apache/commons/rdf/api/fluentparser/package-info.java deleted file mode 100644 index 42c4921..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentparser/package-info.java +++ /dev/null @@ -1,21 +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.commons.rdf.api.fluentparser; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Async.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Async.java b/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Async.java deleted file mode 100644 index e7edcf4..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Async.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.apache.commons.rdf.api.fluentwriter; - -import java.util.concurrent.Future; - -import org.apache.commons.rdf.api.io.Option; -import org.apache.commons.rdf.api.io.Written; - -public interface Async extends _Buildable { - - Async build(); - <V> Async option(Option<V> option, V value); - - Future<Written> writeAsync(); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedSource.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedSource.java b/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedSource.java deleted file mode 100644 index 3070427..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedSource.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.apache.commons.rdf.api.fluentwriter; - -import java.util.stream.Stream; - -import org.apache.commons.rdf.api.Dataset; -import org.apache.commons.rdf.api.Graph; -import org.apache.commons.rdf.api.TripleLike; -import org.apache.commons.rdf.api.io.Option; -import org.apache.commons.rdf.api.io.WriterSource; - -public interface NeedSource extends _Buildable { - - NeedSource build(); - <V> NeedSource option(Option<V> option, V value); - - Sync source(Dataset dataset); - Sync source(Graph graph); - Sync source(Stream<? extends TripleLike> stream); - Sync source(WriterSource source); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedTarget.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedTarget.java b/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedTarget.java deleted file mode 100644 index 2148b54..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedTarget.java +++ /dev/null @@ -1,34 +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.commons.rdf.api.fluentwriter; - -import java.io.OutputStream; -import java.nio.file.Path; - -import org.apache.commons.rdf.api.io.Option; -import org.apache.commons.rdf.api.io.WriterTarget; - -public interface NeedTarget extends _Buildable { - @Override - NeedTarget build(); - <V> NeedTarget option(Option<V> option, V value); - - NeedSource target(Path p); - NeedSource target(OutputStream out); - NeedSource target(WriterTarget target); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Sync.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Sync.java b/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Sync.java deleted file mode 100644 index f6d8afc..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Sync.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.apache.commons.rdf.api.fluentwriter; - -import java.util.concurrent.ExecutorService; - -import org.apache.commons.rdf.api.io.Option; -import org.apache.commons.rdf.api.io.Written; - -public interface Sync extends _Buildable { - - Sync build(); - <V> Sync option(Option<V> option, V value); - - Written write(); // terminal - Async async(); - Async async(ExecutorService service); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/_Buildable.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/_Buildable.java b/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/_Buildable.java deleted file mode 100644 index fc89f60..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/_Buildable.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.commons.rdf.api.fluentwriter; - -import org.apache.commons.rdf.api.io.Option; -import org.apache.commons.rdf.api.io.Option.RequiredOption; -import org.apache.commons.rdf.api.io.ParserFactory; - -interface _Buildable { - /** - * Return an immutable builder at the current state. The returned builder - * can be re-used multiple times in a thread-safe way. - * - * @return An immutable builder - */ - _Buildable build(); - - /** - * Return a builder with the given option set. - * <p> - * Note that implementations of {@link ParserFactory} may support different - * vendor-specific {@link Option} types, and are free to ignore the set - * option (unless it is a {@link RequiredOption}). - * <p> - * It is undefined if setting multiple values for the same (equal) option - * are accumulative or overriding. - * - * @param <V> The type of the {@link Option} value - * @param option Option to set - * @param value Value to set for option - * @return A builder with the given option set - */ - <V> _Buildable option(Option<V> option, V value); - -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/package-info.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/package-info.java b/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/package-info.java deleted file mode 100644 index 85f4c8a..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/fluentwriter/package-info.java +++ /dev/null @@ -1,21 +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.commons.rdf.api.fluentwriter; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/Option.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/Option.java b/api/src/main/java/org/apache/commons/rdf/api/io/Option.java deleted file mode 100644 index 7cf5c86..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/Option.java +++ /dev/null @@ -1,25 +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.commons.rdf.api.io; - -public interface Option<V> { - - public interface RequiredOption<V> extends Option<V> { - - } -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/Parsed.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/Parsed.java b/api/src/main/java/org/apache/commons/rdf/api/io/Parsed.java deleted file mode 100644 index b252e44..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/Parsed.java +++ /dev/null @@ -1,26 +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.commons.rdf.api.io; - -public interface Parsed<T, S> { - long count(); - - ParserSource<S> from(); - - ParserTarget<T> into(); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/ParserBuilder.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/ParserBuilder.java b/api/src/main/java/org/apache/commons/rdf/api/io/ParserBuilder.java deleted file mode 100644 index 037271c..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/ParserBuilder.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.apache.commons.rdf.api.io; - -import org.apache.commons.rdf.api.Dataset; -import org.apache.commons.rdf.api.fluentparser.OptionalTarget; - -public interface ParserBuilder extends OptionalTarget<Dataset> { - ParserBuilder build(); - <V> ParserBuilder option(Option<V> option, V value); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/ParserFactory.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/ParserFactory.java b/api/src/main/java/org/apache/commons/rdf/api/io/ParserFactory.java deleted file mode 100644 index b25a536..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/ParserFactory.java +++ /dev/null @@ -1,27 +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.commons.rdf.api.io; - -import org.apache.commons.rdf.api.Dataset; -import org.apache.commons.rdf.api.RDFSyntax; -import org.apache.commons.rdf.api.fluentparser.NeedTargetOrRDF; -import org.apache.commons.rdf.api.fluentparser.OptionalTargetOrSyntax; - -public interface ParserFactory extends _SupportedSyntaxes, OptionalTargetOrSyntax<Dataset> { - NeedTargetOrRDF syntax(RDFSyntax syntax); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/ParserSource.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/ParserSource.java b/api/src/main/java/org/apache/commons/rdf/api/io/ParserSource.java deleted file mode 100644 index 259688e..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/ParserSource.java +++ /dev/null @@ -1,33 +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.commons.rdf.api.io; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Optional; - -import org.apache.commons.rdf.api.IRI; - -/** - * - */ -public interface ParserSource<S> { - S src(); - InputStream inputStream() throws IOException; - Optional<IRI> iri(); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/ParserTarget.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/ParserTarget.java b/api/src/main/java/org/apache/commons/rdf/api/io/ParserTarget.java deleted file mode 100644 index 8898643..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/ParserTarget.java +++ /dev/null @@ -1,32 +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.commons.rdf.api.io; - -import java.util.function.Consumer; - -import org.apache.commons.rdf.api.Quad; - -/** - * - */ -@FunctionalInterface -public interface ParserTarget<T> extends Consumer<Quad> { - default T dest() { - return null;// unknown - } -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/WriterFactory.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/WriterFactory.java b/api/src/main/java/org/apache/commons/rdf/api/io/WriterFactory.java deleted file mode 100644 index 59815f0..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/WriterFactory.java +++ /dev/null @@ -1,25 +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.commons.rdf.api.io; - -import org.apache.commons.rdf.api.RDFSyntax; -import org.apache.commons.rdf.api.fluentwriter.NeedTarget; - -public interface WriterFactory extends _SupportedSyntaxes { - NeedTarget syntax(RDFSyntax syntax); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/WriterSource.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/WriterSource.java b/api/src/main/java/org/apache/commons/rdf/api/io/WriterSource.java deleted file mode 100644 index 2ce9bbf..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/WriterSource.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.apache.commons.rdf.api.io; - -import java.util.stream.Stream; - -import org.apache.commons.rdf.api.TripleLike; - -public interface WriterSource { - Stream<? extends TripleLike> stream(); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/WriterTarget.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/WriterTarget.java b/api/src/main/java/org/apache/commons/rdf/api/io/WriterTarget.java deleted file mode 100644 index f58f3d4..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/WriterTarget.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.apache.commons.rdf.api.io; - -import java.io.IOException; -import java.io.OutputStream; - -public interface WriterTarget { - OutputStream outputStream() throws IOException; -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/Written.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/Written.java b/api/src/main/java/org/apache/commons/rdf/api/io/Written.java deleted file mode 100644 index 38b5360..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/Written.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.apache.commons.rdf.api.io; - -public interface Written<S,T> { - - WriterSource source(); - - WriterTarget target(); - -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/_SupportedSyntaxes.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/_SupportedSyntaxes.java b/api/src/main/java/org/apache/commons/rdf/api/io/_SupportedSyntaxes.java deleted file mode 100644 index aa3e115..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/_SupportedSyntaxes.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.apache.commons.rdf.api.io; - -import java.util.Set; - -import org.apache.commons.rdf.api.RDFSyntax; - -interface _SupportedSyntaxes { - /** - * Get set of syntaxes supported by this factory. - * <p> - * The returned syntaxes can be used with {@link #syntax(RDFSyntax)} and may - * be used by this factory if no syntax is given. - * <p> - * Note that the factory may support additional syntaxes not returned - * in this set. - * - * @return Set of supported syntaxes - */ - Set<RDFSyntax> supportedSyntaxes(); - - /** - * Use the specified RDF syntax - * - * @param syntax RDFSyntax - * @return Builder that uses specified syntax - */ - Object syntax(RDFSyntax syntax); -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/main/java/org/apache/commons/rdf/api/io/package-info.java ---------------------------------------------------------------------- diff --git a/api/src/main/java/org/apache/commons/rdf/api/io/package-info.java b/api/src/main/java/org/apache/commons/rdf/api/io/package-info.java deleted file mode 100644 index 859d954..0000000 --- a/api/src/main/java/org/apache/commons/rdf/api/io/package-info.java +++ /dev/null @@ -1,21 +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.commons.rdf.api.io; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/api/src/test/java/org/apache/commons/rdf/experimental/Test.java ---------------------------------------------------------------------- diff --git a/api/src/test/java/org/apache/commons/rdf/experimental/Test.java b/api/src/test/java/org/apache/commons/rdf/experimental/Test.java deleted file mode 100644 index cee0854..0000000 --- a/api/src/test/java/org/apache/commons/rdf/experimental/Test.java +++ /dev/null @@ -1,130 +0,0 @@ -package org.apache.commons.rdf.experimental; - -import static org.junit.Assert.*; - -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.apache.commons.rdf.api.Graph; -import org.apache.commons.rdf.api.RDFSyntax; -import org.slf4j.impl.SimpleLoggerFactory; - -interface State { - Path source(); - Graph target(); - RDFSyntax syntax(); - State withSource(Path p); - State withTarget(Graph g); - State withSyntax(RDFSyntax s); -} - -abstract class AbstractState implements State { - @Override - public State withSource(Path p) { - return new WithSource(p, this); - } - @Override - public State withSyntax(RDFSyntax s) { - return new WithSyntax(s, this); - } - @Override - public State withTarget(Graph g) { - return new WithTarget(g, this); - } - -} - -final class DefaultState extends AbstractState { - @Override - public Path source() { - throw new IllegalStateException("Source not set"); - } - @Override - public Graph target() { - throw new IllegalStateException("Target not set"); - } - @Override - public RDFSyntax syntax() { - throw new IllegalStateException("Syntax not set"); - } -} - -abstract class Inherited extends AbstractState { - private final State parent; - public Inherited() { - this(new DefaultState()); - } - public Inherited(State state) { - parent = state; - } - @Override - public Path source() { - return parent.source(); - } - @Override - public Graph target() { - return parent.target(); - } - @Override - public RDFSyntax syntax() { - return parent.syntax(); - } - - -} - -final class WithSource extends Inherited { - private final Path source; - public WithSource(final Path path) { - this.source = path; - } - public WithSource(final Path path, final State state) { - super(state); - this.source = path; - } - @Override - public Path source() { - return source; - } -} - - -final class WithTarget extends Inherited { - private final Graph target; - public WithTarget(final Graph g) { - this.target = g; - } - public WithTarget(final Graph g, final State state) { - super(state); - this.target = g; - } - @Override - public Graph target() { - return target; - } -} - -final class WithSyntax extends Inherited { - private final RDFSyntax syntax; - public WithSyntax(final RDFSyntax s) { - syntax = s; - } - public WithSyntax(final RDFSyntax s, final State state) { - super(state); - syntax = s; - } - @Override - public RDFSyntax syntax() { - return syntax; - } -} - -public class Test { - @org.junit.Test - public void testName() throws Exception { - Path p = Paths.get("/tmp/f.txt"); - Graph g = null; - State s = new DefaultState().withSource(p).withTarget(g).withSyntax(RDFSyntax.JSONLD); - - } -} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java new file mode 100644 index 0000000..ba3fb2d --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Async.java @@ -0,0 +1,31 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import java.util.concurrent.Future; + +import org.apache.commons.rdf.api.io.Option; +import org.apache.commons.rdf.api.io.Parsed; + +public interface Async<T, S> extends _Buildable { + Async<T, S> build(); + + <V> Async<T, S> option(Option<V> option, V value); + + Future<Parsed<T, S>> parseAsync(); +} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java new file mode 100644 index 0000000..54889e1 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceBased.java @@ -0,0 +1,29 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import java.io.InputStream; + +import org.apache.commons.rdf.api.io.Option; + +public interface NeedSourceBased<T> extends _NeedIdentifiedSource<T>, _Buildable { + NeedSourceBased<T> build(); + <V> NeedSourceBased<T> option(Option<V> option, V value); + + Sync<T, InputStream> source(InputStream is); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java new file mode 100644 index 0000000..91b83b7 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedSourceOrBase.java @@ -0,0 +1,25 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import org.apache.commons.rdf.api.io.Option; + +public interface NeedSourceOrBase<T> extends _OptionalBase<T>, _NeedIdentifiedSource<T>, _Buildable { + NeedSourceOrBase<T> build(); + <V> NeedSourceOrBase<T> option(Option<V> option, V value); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java new file mode 100644 index 0000000..4ed3849 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTarget.java @@ -0,0 +1,25 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import org.apache.commons.rdf.api.io.Option; + +interface NeedTarget extends _NeedTarget,_Buildable { + NeedTarget build(); + <V> NeedTarget option(Option<V> option, V value); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java new file mode 100644 index 0000000..109b70d --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDF.java @@ -0,0 +1,25 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import org.apache.commons.rdf.api.io.Option; + +public interface NeedTargetOrRDF extends _NeedTargetOrRDF,_Buildable { + NeedTargetOrRDF build(); + <V> NeedTargetOrRDF option(Option<V> option, V value); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDFOrSyntax.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDFOrSyntax.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDFOrSyntax.java new file mode 100644 index 0000000..61a0256 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/NeedTargetOrRDFOrSyntax.java @@ -0,0 +1,22 @@ +/** + * 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.commons.rdf.api.fluentparser; + +public interface NeedTargetOrRDFOrSyntax extends _NeedTargetOrRDF, _NeedSyntax { + +} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java new file mode 100644 index 0000000..be8195c --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTarget.java @@ -0,0 +1,25 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import org.apache.commons.rdf.api.io.Option; + +public interface OptionalTarget<T> extends _NeedTarget, NeedSourceOrBase<T>,_Buildable { + OptionalTarget<T> build(); + <V> OptionalTarget<T> option(Option<V> option, V value); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java new file mode 100644 index 0000000..7dee7e4 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/OptionalTargetOrSyntax.java @@ -0,0 +1,5 @@ +package org.apache.commons.rdf.api.fluentparser; + +public interface OptionalTargetOrSyntax<T> extends OptionalTarget<T>, _NeedSyntax { + +} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java new file mode 100644 index 0000000..c141a18 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/Sync.java @@ -0,0 +1,32 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import java.util.concurrent.ExecutorService; + +import org.apache.commons.rdf.api.io.Option; +import org.apache.commons.rdf.api.io.Parsed; + +public interface Sync<T, S> extends _Buildable{ + Sync<T ,S> build(); + <V> Sync<T, S> option(Option<V> option, V value); + + Async<T, S> async(); + Async<T, S> async(ExecutorService executor); + Parsed<T, S> parse(); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java new file mode 100644 index 0000000..b21eb9d --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_Buildable.java @@ -0,0 +1,50 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import org.apache.commons.rdf.api.io.Option; +import org.apache.commons.rdf.api.io.Option.RequiredOption; +import org.apache.commons.rdf.api.io.ParserFactory; + +interface _Buildable { + /** + * Return an immutable builder at the current state. The returned builder + * can be re-used multiple times in a thread-safe way. + * + * @return An immutable builder + */ + _Buildable build(); + + /** + * Return a builder with the given option set. + * <p> + * Note that implementations of {@link ParserFactory} may support different + * vendor-specific {@link Option} types, and are free to ignore the set + * option (unless it is a {@link RequiredOption}). + * <p> + * It is undefined if setting multiple values for the same (equal) option + * are accumulative or overriding. + * + * @param <V> The type of the {@link Option} value + * @param option Option to set + * @param value Value to set for option + * @return A builder with the given option set + */ + <V> _Buildable option(Option<V> option, V value); + +} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java new file mode 100644 index 0000000..580adf6 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedIdentifiedSource.java @@ -0,0 +1,35 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import java.nio.file.Path; + +import javax.xml.transform.Source; + +import org.apache.commons.rdf.api.IRI; +import org.apache.commons.rdf.api.io.ParserSource; + +interface _NeedIdentifiedSource<T> { + Sync<T, IRI> source(IRI iri); + + Sync<T, Path> source(Path path); + + <S> Sync<T, S> source(ParserSource<S> source); + + Sync<T, IRI> source(String iri); +} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java new file mode 100644 index 0000000..28f0cd1 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedSyntax.java @@ -0,0 +1,7 @@ +package org.apache.commons.rdf.api.fluentparser; + +import org.apache.commons.rdf.api.RDFSyntax; + +interface _NeedSyntax { + NeedTargetOrRDF syntax(RDFSyntax syntax); +} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTarget.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTarget.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTarget.java new file mode 100644 index 0000000..2053f3b --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTarget.java @@ -0,0 +1,30 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import org.apache.commons.rdf.api.Dataset; +import org.apache.commons.rdf.api.Graph; +import org.apache.commons.rdf.api.io.ParserTarget; + +interface _NeedTarget { + NeedSourceOrBase<Dataset> target(Dataset dataset); + + NeedSourceOrBase<Graph> target(Graph graph); + + <T> NeedSourceOrBase<T> target(ParserTarget<T> target); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTargetOrRDF.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTargetOrRDF.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTargetOrRDF.java new file mode 100644 index 0000000..89016b4 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_NeedTargetOrRDF.java @@ -0,0 +1,21 @@ +/** + * 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.commons.rdf.api.fluentparser; + +interface _NeedTargetOrRDF extends _NeedTarget, _OptionalRDF { +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalBase.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalBase.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalBase.java new file mode 100644 index 0000000..3e3235c --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalBase.java @@ -0,0 +1,26 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import org.apache.commons.rdf.api.IRI; + +interface _OptionalBase<T> { + NeedSourceBased<T> base(IRI iri); + + NeedSourceBased<T> base(String iri); +} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalRDF.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalRDF.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalRDF.java new file mode 100644 index 0000000..80ac15b --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/_OptionalRDF.java @@ -0,0 +1,25 @@ +/** + * 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.commons.rdf.api.fluentparser; + +import org.apache.commons.rdf.api.Dataset; +import org.apache.commons.rdf.api.RDF; + +interface _OptionalRDF { + OptionalTarget<Dataset> rdf(RDF rdf); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/package-info.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/package-info.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/package-info.java new file mode 100644 index 0000000..42c4921 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentparser/package-info.java @@ -0,0 +1,21 @@ +/* + * 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.commons.rdf.api.fluentparser; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Async.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Async.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Async.java new file mode 100644 index 0000000..e7edcf4 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentwriter/Async.java @@ -0,0 +1,14 @@ +package org.apache.commons.rdf.api.fluentwriter; + +import java.util.concurrent.Future; + +import org.apache.commons.rdf.api.io.Option; +import org.apache.commons.rdf.api.io.Written; + +public interface Async extends _Buildable { + + Async build(); + <V> Async option(Option<V> option, V value); + + Future<Written> writeAsync(); +} http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/96fb0f06/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedSource.java ---------------------------------------------------------------------- diff --git a/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedSource.java b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedSource.java new file mode 100644 index 0000000..3070427 --- /dev/null +++ b/commons-rdf-api/src/main/java/org/apache/commons/rdf/api/fluentwriter/NeedSource.java @@ -0,0 +1,20 @@ +package org.apache.commons.rdf.api.fluentwriter; + +import java.util.stream.Stream; + +import org.apache.commons.rdf.api.Dataset; +import org.apache.commons.rdf.api.Graph; +import org.apache.commons.rdf.api.TripleLike; +import org.apache.commons.rdf.api.io.Option; +import org.apache.commons.rdf.api.io.WriterSource; + +public interface NeedSource extends _Buildable { + + NeedSource build(); + <V> NeedSource option(Option<V> option, V value); + + Sync source(Dataset dataset); + Sync source(Graph graph); + Sync source(Stream<? extends TripleLike> stream); + Sync source(WriterSource source); +}