");
28 |
29 | public static String version() { return VERSION; }
30 | }
31 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/RefLong.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | /** Reference to an integer value (as a long) */
21 | public interface RefLong {
22 |
23 | /** Get the current value */
24 | public long getInteger();
25 |
26 | /** Set the current value */
27 | public void setInteger(long value);
28 |
29 | /** Increment the current value and return the new value (link {@code ++x} not like {@code X++}) */
30 | public long inc();
31 | }
32 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/RefLongMem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | // AtomicLong.
21 | public class RefLongMem implements RefLong {
22 | private long value;
23 |
24 | public RefLongMem(long x) { this.value = x; }
25 |
26 | @Override
27 | public long getInteger() {
28 | return value;
29 | }
30 |
31 | @Override
32 | public void setInteger(long value) {
33 | this.value = value ;
34 | }
35 |
36 | @Override
37 | public long inc() {
38 | return (++value);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/RefString.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | /** Reference to a string value */
21 | public interface RefString {
22 |
23 | /** Get the current value */
24 | public String getString();
25 |
26 | /** Set the current value */
27 | public void setString(String value);
28 | }
29 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/RefStringMem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | public class RefStringMem implements RefString {
21 | private String value;
22 |
23 | public RefStringMem(String x) { this.value = x; }
24 |
25 | @Override
26 | public String getString() {
27 | return value;
28 | }
29 |
30 | @Override
31 | public void setString(String value) { this.value = value; }
32 | }
33 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/StateLongString.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | public class StateLongString implements RefLong, RefString {
21 |
22 | @Override
23 | public String getString() {
24 | return null;
25 | }
26 |
27 | @Override
28 | public void setString(String value) {}
29 |
30 | @Override
31 | public long getInteger() {
32 | return 0;
33 | }
34 |
35 | @Override
36 | public void setInteger(long value) {}
37 |
38 | @Override
39 | public long inc() {
40 | return 0;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/lib/LogX.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.lib;
19 |
20 | import org.apache.jena.atlas.logging.LogCtl;
21 | import org.apache.jena.atlas.logging.LogCtlJUL;
22 |
23 | public class LogX {
24 |
25 | //Indirection for setting Java logging (used in tests)
26 | public static void setJavaLogging(String file) {
27 | LogCtlJUL.setJavaLogging(file);
28 | }
29 |
30 | //Indirection for setting Java logging (used in tests)
31 | public static void setJavaLogging() {
32 | LogCtl.setJavaLogging();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/link/DeltaLinkListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.link;
19 |
20 | import org.seaborne.delta.Id;
21 | import org.seaborne.delta.Version;
22 | import org.apache.jena.rdfpatch.RDFPatch;
23 |
24 | /**
25 | * {@link DeltaLink} listener.
26 | * Events occur for DataSource changes and for patch actions.
27 | */
28 | public interface DeltaLinkListener {
29 | public default void newDataSource(Id dsRef, String name) {}
30 | public default void copyDataSource(Id dsRef, Id dsRef2, String oldName, String newName) {}
31 | public default void renameDataSource(Id dsRef, Id dsRef2, String oldName, String newName) {}
32 | public default void removeDataSource(Id dsRef) {}
33 |
34 | /** {@code patch} is null for "not found". */
35 | public default void fetchById(Id dsRef, Id patchId, RDFPatch patch) {}
36 | public default void fetchByVersion(Id dsRef, Version version, RDFPatch patch) {}
37 | /** Version.UNSET on error.*/
38 | public default void append(Id dsRef, Version version, RDFPatch patch) {}
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/link/DeltaNotConnectedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.link;
19 |
20 | import org.seaborne.delta.DeltaException;
21 |
22 | public class DeltaNotConnectedException extends DeltaException
23 | {
24 | public DeltaNotConnectedException() { super() ; }
25 | public DeltaNotConnectedException(String msg) { super(msg) ; }
26 | public DeltaNotConnectedException(Throwable th) { super(th) ; }
27 | public DeltaNotConnectedException(String msg, Throwable th) { super(msg, th) ; }
28 | }
29 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/link/DeltaNotRegisteredException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.link;
19 |
20 | import org.apache.jena.web.HttpSC ;
21 | import org.seaborne.delta.DeltaHttpException ;
22 |
23 | public class DeltaNotRegisteredException extends DeltaHttpException
24 | {
25 | public DeltaNotRegisteredException() { this("Not registered") ; }
26 | public DeltaNotRegisteredException(String msg) { super(HttpSC.UNAUTHORIZED_401, msg) ; }
27 | }
28 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/link/LinkEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.link;
19 |
20 | public class LinkEvent {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/java/org/seaborne/delta/sys/InitDelta.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.sys;
19 |
20 | import org.apache.jena.sys.JenaSubsystemLifecycle ;
21 | import org.seaborne.delta.Delta ;
22 | import org.apache.jena.rdfpatch.system.InitPatch ;
23 |
24 | /** General subsystem initialization using Jena system initialization.
25 | *
26 | * Jena system initialization
27 | *
28 | * See {@code DeltaSystem.init} for details of the server initialization.
29 | */
30 | public class InitDelta implements JenaSubsystemLifecycle {
31 | public static final int level = InitPatch.level+10;
32 |
33 | @Override
34 | public void start() {
35 | Delta.init() ;
36 | }
37 |
38 | @Override
39 | public void stop() {}
40 |
41 | @Override
42 | public int level() { return level ; }
43 | }
44 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/resources/META-INF/NOTICE:
--------------------------------------------------------------------------------
1 | RDF Delta
2 | =========
3 |
4 | Copyright 2013, 2014, 2015, 2016 Andy Seaborne
5 | Copyright 2016 TopQuadrant Inc.
6 |
7 | Portions of this software derive from Apache Jena.
8 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/resources/META-INF/services/org.apache.jena.sys.JenaSubsystemLifecycle:
--------------------------------------------------------------------------------
1 | org.seaborne.delta.sys.InitDelta
2 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/main/resources/org/seaborne/delta/delta-properties.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | RDF Delta System Properties
6 | ${project.version}
7 | ${build.time.xsd}
8 |
9 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/test/java/org/seaborne/delta/TS_DeltaBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.runner.RunWith ;
21 | import org.junit.runners.Suite ;
22 |
23 | @RunWith(Suite.class)
24 | @Suite.SuiteClasses( {
25 | TestId.class
26 | , TestVersion.class
27 | , TestPersistentState.class
28 | })
29 |
30 | public class TS_DeltaBase { }
31 |
--------------------------------------------------------------------------------
/rdf-delta-base/src/test/resources/logging.properties:
--------------------------------------------------------------------------------
1 | handlers=org.apache.jena.atlas.logging.java.ConsoleHandlerStream
2 | org.apache.jena.atlas.logging.java.ConsoleHandlerStream.level = ALL
3 | .level=ALL
4 |
5 | ## org.apache.jena.atlas.logging.java.ConsoleHandlerStream.level=INFO
6 | ## org.apache.jena.atlas.logging.java.ConsoleHandlerStdout.formatter = \
7 | ## org.apache.jena.atlas.logging.java.TextFormatter
8 |
9 | ## default: %5$tT %3$-5s %2$-20s :: %6$s
10 | ## Full name %1 and milliseconds %5$tL %$
11 | ## date/time : [%5$tF %5$tT]
12 | ## %5$tT.%5$tL %3$-5s %1$-20s :: %6$s
13 |
14 | org.apache.jena.atlas.logging.java.TextFormatter.format = %5$tT %3$-5s %2$-20s : %6$s
15 |
16 | org.seaborne.delta.level = WARNING
17 | Delta.level = WARNING
18 |
19 | org.apache.zookeeper.level = WARNING
20 | org.apache.curator.level = WARNING
21 |
22 | org.apache.jena.level = INFO
23 | org.apache.jena.fuseki.level = WARNING
24 |
25 | ## Fuseki loggers
26 | # The server setup./configuration log.
27 | org.apache.jena.fuseki.Server.level=OFF
28 |
29 | # The action lifecycle log.
30 | org.apache.jena.fuseki.Fuseki.level = OFF
31 |
32 | # NCSA Format logging.
33 | org.apache.jena.fuseki.Request.level = OFF
34 | org.apache.jena.fuseki.Request.useParentHandlers = false
35 | org.apache.jena.fuseki.Request.handlers = org.apache.jena.atlas.logging.java.FlatHandler
36 |
37 | ## # Others
38 | org.eclipse.jetty.level = WARNING
39 | org.eclipse.jetty.server.level = WARNING
40 | org.eclipse.jetty.util.log.level = WARNING
41 | org.apache.shiro.level = WARNING
42 | org.apache.http.level = INFO
43 |
--------------------------------------------------------------------------------
/rdf-delta-client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | 4.0.0
22 | rdf-delta-client
23 | jar
24 |
25 | RDF Delta :: Client
26 |
27 |
28 | org.seaborne.rdf-delta
29 | rdf-delta
30 | 2.0.0-SNAPSHOT
31 |
32 |
33 |
34 | org.seaborne.rdf_delta.client
35 |
36 |
37 |
38 |
39 | org.seaborne.rdf-delta
40 | rdf-delta-base
41 | 2.0.0-SNAPSHOT
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/rdf-delta-client/src/main/java/org/seaborne/delta/client/FN.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.client;
19 |
20 | /** File names for the client-side zone state. */
21 | class FN {
22 | /** The database area - client side directory (TDB or with files) */
23 | public static final String DATA = "data";
24 |
25 | /** Name of the file holding the persistent state, client DeltaConnection. */
26 | public static final String STATE = "state";
27 | }
28 |
--------------------------------------------------------------------------------
/rdf-delta-client/src/main/java/org/seaborne/delta/client/InitDeltaClient.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.client;
19 |
20 | import org.apache.jena.sys.JenaSubsystemLifecycle;
21 | import org.apache.jena.sys.JenaSystem;
22 | import org.seaborne.delta.client.assembler.VocabDelta;
23 | import org.seaborne.delta.sys.InitDelta;
24 |
25 | /** Delta client initialization using Jena system initialization.
26 | *
27 | * Jena system initialization
28 | *
29 | * See {@code DeltaSystem.init} for details of the server initialization.
30 | */
31 | public class InitDeltaClient implements JenaSubsystemLifecycle {
32 | public static final int level = InitDelta.level+1;
33 |
34 | @Override
35 | public void start() {
36 | JenaSystem.logLifecycle("InitDeltaClient - start");
37 | VocabDelta.init();
38 | JenaSystem.logLifecycle("InitDeltaClient - finish");
39 | }
40 |
41 | @Override
42 | public void stop() {}
43 |
44 | @Override
45 | public int level() { return level; }
46 | }
47 |
--------------------------------------------------------------------------------
/rdf-delta-client/src/main/java/org/seaborne/delta/client/SyncPolicy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.client;
19 |
20 | /**
21 | * When to synchronize with a patch log.
22 | * {@link DeltaConnection} provides the option of syncing automatically on transaction begin.
23 | * The application call also call {@link DeltaConnection#sync} itself.
24 | *
25 | * - {@code NONE} No automatic sync, all done by the application.
26 | *
- {@code TXN_RW} When a transaction starts (sync attempt for a READ transaction suppresses network errors).
27 | *
- {@code TXN_W} When a write-transaction starts.
28 | *
29 | */
30 | public enum SyncPolicy { NONE, TXN_RW, TXN_W }
31 |
--------------------------------------------------------------------------------
/rdf-delta-client/src/main/java/org/seaborne/delta/client/assembler/DatasetNoChangesAssembler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.client.assembler;
19 |
20 | public class DatasetNoChangesAssembler {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/rdf-delta-client/src/main/resources/META-INF/NOTICE:
--------------------------------------------------------------------------------
1 | RDF Delta
2 | =========
3 |
4 | Copyright 2013, 2014, 2015, 2016 Andy Seaborne
5 | Copyright 2016 TopQuadrant Inc.
6 |
7 | Portions of this software derive from Apache Jena.
8 |
--------------------------------------------------------------------------------
/rdf-delta-client/src/main/resources/META-INF/services/org.apache.jena.sys.JenaSubsystemLifecycle:
--------------------------------------------------------------------------------
1 | org.seaborne.delta.client.InitDeltaClient
2 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/bin/list:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | DP_ROOT="${DP_ROOT:-$HOME/ASF/rdf-delta/}"
5 | ARGS="$@"
6 |
7 | $DP_ROOT/rdf-delta-cmds/bin/dcmd "$(basename $0)" $ARGS
8 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/bin/mksrc:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | DP_ROOT="${DP_ROOT:-$HOME/ASF/rdf-delta/}"
5 | ARGS="$@"
6 |
7 | $DP_ROOT/rdf-delta-cmds/bin/dcmd "$(basename $0)" $ARGS
8 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/bin/patchserver:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | DP_ROOT="${DP_ROOT:-$HOME/ASF/rdf-delta/}"
5 | ARGS="$@"
6 |
7 | $DP_ROOT/rdf-delta-cmds/bin/dcmd "$(basename $0)" $ARGS
8 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/bin/rdf2patch:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | DP_ROOT="${DP_ROOT:-$HOME/ASF/rdf-delta/}"
5 | ARGS="$@"
6 |
7 | $DP_ROOT/rdf-delta-cmds/bin/dcmd org.seaborne.delta.cmds.rdf2patch $ARGS
8 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/bin/rmsrc:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | DP_ROOT="${DP_ROOT:-$HOME/ASF/rdf-delta/}"
5 | ARGS="$@"
6 |
7 | $DP_ROOT/rdf-delta-cmds/bin/dcmd "$(basename $0)" $ARGS
8 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/src/main/java/dcmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | public class dcmd {
19 |
20 | public static void main(String[] args) {
21 | org.seaborne.delta.cmds.dcmd.main(args);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/src/main/java/delta/dcmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package delta;
19 |
20 | public class dcmd {
21 |
22 | public static void main(String... args) {
23 | org.seaborne.delta.cmds.dcmd.main(args);
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/src/main/java/delta/server/ZkJVM.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package delta.server;
19 |
20 | import org.apache.curator.test.TestingServer;
21 |
22 | class ZkJVM {
23 | private static TestingServer buildZooJVM(int port) {
24 | try {
25 | TestingServer zkServer = new TestingServer(port);
26 | return zkServer;
27 | } catch (Exception ex) {
28 | throw new RuntimeException(ex);
29 | }
30 | }
31 |
32 | public static String startZooJVM() {
33 | try {
34 | @SuppressWarnings("resource")
35 | TestingServer zkServer = new TestingServer();
36 | zkServer.start();
37 | return "localhost:" + zkServer.getPort();
38 | } catch (Exception ex) {
39 | throw new RuntimeException(ex);
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/src/test/java/org/seaborne/delta/cmds/MockS3.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.cmds;
19 |
20 | import io.findify.s3mock.S3Mock;
21 | import org.apache.jena.atlas.lib.Lib;
22 |
23 | /** Run a mock S3 using io.findify */
24 | public class MockS3 {
25 | public static void main(String... args) {
26 | int PORT = 1357;
27 | String region = "eu-bristol-1";
28 | //// AWSCredentials credentials = new AnonymousAWSCredentials();
29 | //// EndpointConfiguration endpoint = new EndpointConfiguration("http://localhost:"+port, region);
30 | S3Mock api = new S3Mock.Builder().withPort(PORT).withInMemoryBackend().build();
31 | api.start();
32 | System.out.println("MockS3 running");
33 | while(true) {
34 | Lib.sleep(1000);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/src/test/java/org/seaborne/delta/cmds/TS_DeltaCmds.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.cmds;
19 |
20 | import org.junit.AfterClass;
21 | import org.junit.BeforeClass;
22 | import org.junit.runner.RunWith;
23 | import org.junit.runners.Suite;
24 | import org.junit.runners.Suite.SuiteClasses;
25 |
26 | @RunWith(Suite.class)
27 | @SuiteClasses( {
28 | TestLocalServerCmdSetup.class
29 | , TestDeltaServerConfig.class
30 | , TestCmds.class
31 | , TestCmdServer.class
32 | , TestCmdServerZkS3.class
33 | })
34 |
35 | public class TS_DeltaCmds {
36 | @BeforeClass public static void beforeClass() {
37 | // Our choice.
38 | System.setProperty("log4j.configurationFile", "src/test/resources/log4j2-test.properties");
39 | }
40 |
41 | @AfterClass public static void afterClass() {}
42 | }
43 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/testing/data.rdfp:
--------------------------------------------------------------------------------
1 | H id .
2 | TB .
3 | PA "rdf" .
4 | PD "rdf" .
5 | A .
6 | D .
7 | TC.
8 |
--------------------------------------------------------------------------------
/rdf-delta-cmds/testing/jetty.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 | localhost
35 | 1070
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/rdf-delta-dist/Files/dcmd:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | ## Sets up the java enviroment to run a command from RDF Delta.
5 |
6 | # Location of the delta-server.jar, which also contains the commands.
7 | DELTA_HOME="${DELTA_HOME:-$PWD}"
8 | CP=''
9 | if [[ -e "$DELTA_HOME/delta-patch-server.jar" ]] ; then
10 | CP="$DELTA_HOME/delta-patch-server.jar"
11 | elif [[ -e "$DELTA_HOME/delta-server.jar" ]] ; then
12 | CP="$DELTA_HOME/delta-server.jar"
13 | else
14 | echo "Can't find the jar containing the RDF Delta cmds (delta-patch-server.jar)" 1>&2
15 | exit 1
16 | fi
17 |
18 | if [[ -e "log4j2.xml" ]]
19 | then
20 | LOGGING="-Dlog4j.configurationFile=log4j2.xml -Dlog4j.configuration=delta"
21 | fi
22 |
23 | function usage() {
24 | echo "Commands: server, ls, mk, rm, list, get, add, parse, path, r2p, p2r, fuseki" 1>&2
25 | ##echo "Class path: $DELTA_CP:${JENA_CP}"
26 | exit
27 | }
28 |
29 | if [[ $# = 0 ]]
30 | then
31 | usage
32 | exit
33 | fi
34 |
35 | exec java $JVM_ARGS $LOGGING -cp "$CP" dcmd "$@"
36 |
--------------------------------------------------------------------------------
/rdf-delta-dist/Files/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/rdf-delta-dist/README:
--------------------------------------------------------------------------------
1 | RDF Delta
2 | =========
3 |
4 | This is the the "Delta Server" that coordinates patches.
5 |
6 | http://github.com/afs/rdf-delta
7 |
8 | for status and documentation.
9 |
10 | To run the server:
11 |
12 | java -jar delta-server.jar --base DIR
13 |
14 | where DIR is the directory for storing pacthes.
15 |
--------------------------------------------------------------------------------
/rdf-delta-dist/jetty.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 | localhost
35 | 1068
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/rdf-delta-examples/.gitignore:
--------------------------------------------------------------------------------
1 | /--mem--/
2 | /DeltaServer/
3 | /Zone*/
4 | **/version-2/
5 |
--------------------------------------------------------------------------------
/rdf-delta-examples/ExampleFusekiConfigs/fuseki_conf.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX : <#>
4 | PREFIX fuseki:
5 | PREFIX rdf:
6 | PREFIX rdfs:
7 | PREFIX ja:
8 | PREFIX delta:
9 |
10 | [] rdf:type fuseki:Server ;
11 | .
12 |
13 | <#service1> rdf:type fuseki:Service ;
14 | fuseki:name "ds1" ;
15 | fuseki:serviceQuery "sparql" ;
16 | fuseki:serviceQuery "query" ;
17 | fuseki:serviceUpdate "update" ;
18 | fuseki:serviceUpload "upload" ;
19 | fuseki:serviceReadWriteGraphStore "data" ;
20 | fuseki:serviceReadGraphStore "get" ;
21 | fuseki:dataset <#dataset> ;
22 | .
23 |
24 | <#dataset> rdf:type delta:DeltaDataset ;
25 | delta:changes "http://localhost:1069/" ;
26 | delta:patchlog "ABC";
27 | delta:zone "Zone1";
28 | delta:storage "mem";
29 | .
30 |
--------------------------------------------------------------------------------
/rdf-delta-examples/ExampleFusekiConfigs/fuseki_conf_1.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX : <#>
4 | PREFIX fuseki:
5 | PREFIX rdf:
6 | PREFIX rdfs:
7 | PREFIX ja:
8 | PREFIX delta:
9 |
10 | [] rdf:type fuseki:Server ;
11 | .
12 |
13 | <#service1> rdf:type fuseki:Service ;
14 | fuseki:name "ds" ;
15 | fuseki:serviceQuery "sparql" ;
16 | fuseki:serviceQuery "query" ;
17 | fuseki:serviceUpdate "update" ;
18 | fuseki:serviceUpload "upload" ;
19 | fuseki:serviceReadWriteGraphStore "data" ;
20 | fuseki:serviceReadGraphStore "get" ;
21 | fuseki:dataset <#dataset> ;
22 | .
23 |
24 | <#dataset> rdf:type delta:DeltaDataset ;
25 | delta:changes "http://localhost:1066/" ;
26 | delta:patchlog "ABC";
27 | delta:storage "mem";
28 | .
29 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/data.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX :
4 |
5 | :s :p "bar" .
6 | :s :p "foo"@en .
7 | :s :p 123 .
8 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/fuseki-config.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | ## Example RDF Delta + Fuseki configuration.
4 |
5 | PREFIX : <#>
6 | PREFIX fuseki:
7 | PREFIX rdf:
8 | PREFIX rdfs:
9 | PREFIX ja:
10 | PREFIX delta:
11 |
12 | [] rdf:type fuseki:Server ;
13 | .
14 |
15 | <#service1> rdf:type fuseki:Service ;
16 | fuseki:name "ds" ;
17 | fuseki:serviceQuery "sparql" ;
18 | fuseki:serviceQuery "query" ;
19 | fuseki:serviceUpdate "update" ;
20 | fuseki:serviceUpload "upload" ;
21 | fuseki:serviceReadWriteGraphStore "data" ;
22 | fuseki:serviceReadGraphStore "get" ;
23 | fuseki:dataset <#dataset> ;
24 | .
25 |
26 | <#dataset> rdf:type delta:DeltaDataset ;
27 | delta:changes "http://localhost:1066/" ;
28 | delta:patchlog "ABC";
29 | delta:storage "mem";
30 |
31 | ## Other storage options:
32 | ## delta:storage "tdb2";
33 | ## delta:storage "tdb";
34 | ## ## Fuskei server, Delta client area - must not be shared between servers.
35 | ## delta:zone "Zone";
36 |
37 | .
38 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/patch.rdfp:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | H ID .
4 | TB .
5 | PA "" "http://example/" .
6 | A 1816 .
7 | A <_:c097fcf795d4cc69b728a7b0f4cce050> .
8 | TC .
9 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/clean:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | ## This script resets the persistent states
5 |
6 | ## Delete Zookeeper databases.
7 | rm -rf zk?/ZkData/version-2
8 |
9 | ## Delete the persistent zone information for Fuseki datasets.
10 | rm -rf fuseki?/Zone/*
11 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/dzk-server:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | ## Run a RDF Delta Patch Log Server
5 | ## This is the common script run from within directories zk1, zk2 and zk3.
6 |
7 | ID=$(cat ZkData/myid)
8 | CONNECT="localhost:2181,localhost:2182,localhost:2183"
9 | PORT="107${ID}"
10 |
11 | echo "Run Delta Patch Server : id = $ID : port = $PORT"
12 |
13 | dcmd server --port "$PORT" --zk="$CONNECT" --zkCfg=./zoo.cfg
14 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/fuseki1/config.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX : <#>
4 | PREFIX fuseki:
5 | PREFIX rdf:
6 | PREFIX rdfs:
7 | PREFIX ja:
8 | PREFIX delta:
9 |
10 | [] rdf:type fuseki:Server ;
11 | .
12 |
13 | <#service1> rdf:type fuseki:Service ;
14 | fuseki:name "ds" ;
15 | fuseki:serviceQuery "sparql" ;
16 | fuseki:serviceQuery "query" ;
17 | fuseki:serviceUpdate "update" ;
18 | fuseki:serviceUpload "upload" ;
19 | fuseki:serviceReadWriteGraphStore "data" ;
20 | fuseki:serviceReadGraphStore "get" ;
21 | fuseki:dataset <#dataset> ;
22 | .
23 |
24 | <#dataset> rdf:type delta:DeltaDataset ;
25 | ## List of Delta Patch Servers
26 | delta:changes ("http://localhost:1071/" "http://localhost:1072/" "http://localhost:1073/") ;
27 | ## Name of patch log
28 | delta:patchlog "ABC";
29 | ## Name of local directory used for the storage of Jena database and Delta client state.
30 | delta:zone "Zone";
31 | ## Choices: "mem", "tdb", "tdb2"
32 | delta:storage "tdb";
33 | .
34 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/fuseki1/run-fuseki:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | dcmd fuseki --port 3031 --conf config.ttl
5 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/fuseki2/config.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX : <#>
4 | PREFIX fuseki:
5 | PREFIX rdf:
6 | PREFIX rdfs:
7 | PREFIX ja:
8 | PREFIX delta:
9 |
10 | [] rdf:type fuseki:Server ;
11 | .
12 |
13 | <#service1> rdf:type fuseki:Service ;
14 | fuseki:name "ds" ;
15 | fuseki:serviceQuery "sparql" ;
16 | fuseki:serviceQuery "query" ;
17 | fuseki:serviceUpdate "update" ;
18 | fuseki:serviceUpload "upload" ;
19 | fuseki:serviceReadWriteGraphStore "data" ;
20 | fuseki:serviceReadGraphStore "get" ;
21 | fuseki:dataset <#dataset> ;
22 | .
23 |
24 | <#dataset> rdf:type delta:DeltaDataset ;
25 | ## List of Delta Patch Servers
26 | delta:changes ("http://localhost:1071/" "http://localhost:1072/" "http://localhost:1073/") ;
27 | ## Name of patch log
28 | delta:patchlog "ABC";
29 | ## Name of local directory used for the storage of Jena database and Delta client state.
30 | delta:zone "Zone";
31 | ## Choices: "mem", "tdb", "tdb2"
32 | delta:storage "tdb";
33 | .
34 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/fuseki2/run-fuseki:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | dcmd fuseki --port 3032 --conf config.ttl
5 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/single/log4j.properties:
--------------------------------------------------------------------------------
1 | log4j.rootLogger=INFO, stdlog
2 |
3 | log4j.appender.stdlog=org.apache.log4j.ConsoleAppender
4 | ## log4j.appender.stdlog.target=System.err
5 | log4j.appender.stdlog.layout=org.apache.log4j.PatternLayout
6 | log4j.appender.stdlog.layout.ConversionPattern=%d{HH:mm:ss} %-5p %-20c :: %m%n
7 |
8 | # Zookeeper
9 | log4j.logger.org.apache.zookeeper = INFO
10 | log4j.logger.org.apache.zookeeper.server.NIOServerCnxn = ERROR
11 | log4j.logger.org.apache.zookeeper.jmx.ManagedUtil = WARN
12 | log4j.logger.org.apache.zookeeper.server.quorum.QuorumPeerMain = ERROR
13 |
14 | log4j.logger.org.apache.curator = INFO
15 |
16 | # Too much for development.
17 | log4j.logger.org.apache.zookeeper.server = WARN
18 | log4j.logger.org.eclipse.jetty = WARN
19 | log4j.logger.org.eclipse.jetty.server.handler.ContextHandler = ERROR
20 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/single/zk-run:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | export JMXDISABLE=true
5 |
6 | ~/Projects/zookeeper/bin/zkServer.sh --config . start-foreground
7 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/single/zoo.cfg:
--------------------------------------------------------------------------------
1 | tickTime=2000
2 | dataDir=/home/afs/ASF/rdf-delta-dev/zk/single/zk-data
3 | clientPort=2180
4 | admin.serverPort=3180
5 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk1/ZkData/myid:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk1/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk1/run-delta:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | ## The master script looks in data/myid
5 | exec ../dzk-server
6 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk1/run-zk:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | export JMXDISABLE=true
5 |
6 | ARGS="$@"
7 | if [[ $# == 0 ]]
8 | then
9 | ARGS=start-foreground
10 | fi
11 |
12 | ~/Projects/zookeeper/bin/zkServer.sh --config . $ARGS
13 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk1/zoo.cfg:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 | admin.enableServer=false
3 | dataDir=./ZkData
4 | initLimit=5
5 | tickTime=2000
6 | syncLimit=2
7 | dynamicConfigFile=zoo.dynamic
8 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk1/zoo.dynamic:
--------------------------------------------------------------------------------
1 | server.1=localhost:2281:3381:participant;2181
2 | server.2=localhost:2282:3382:participant;2182
3 | server.3=localhost:2283:3383:participant;2183
4 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk2/ZkData/myid:
--------------------------------------------------------------------------------
1 | 2
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk2/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk2/run-delta:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | ## The master script looks in data/myid
5 | exec ../server
6 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk2/run-zk:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | export JMXDISABLE=true
5 |
6 | ARGS="$@"
7 | if [[ $# == 0 ]]
8 | then
9 | ARGS=start-foreground
10 | fi
11 |
12 | ~/Projects/zookeeper/bin/zkServer.sh --config . $ARGS
13 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk2/zoo.cfg:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 | admin.enableServer=false
3 | dataDir=./ZkData
4 | initLimit=5
5 | tickTime=2000
6 | syncLimit=2
7 | dynamicConfigFile=zoo.dynamic
8 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk2/zoo.dynamic:
--------------------------------------------------------------------------------
1 | server.1=localhost:2281:3381:participant;2181
2 | server.2=localhost:2282:3382:participant;2182
3 | server.3=localhost:2283:3383:participant;2183
4 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk3/ZkData/myid:
--------------------------------------------------------------------------------
1 | 3
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk3/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk3/run-delta:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | ## The master script looks in data/myid
5 | exec ../server
6 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk3/run-zk:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
3 |
4 | export JMXDISABLE=true
5 |
6 | ARGS="$@"
7 | if [[ $# == 0 ]]
8 | then
9 | ARGS=start-foreground
10 | fi
11 |
12 | ~/Projects/zookeeper/bin/zkServer.sh --config . $ARGS
13 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk3/zoo.cfg:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 | admin.enableServer=false
3 | dataDir=./ZkData
4 | initLimit=5
5 | tickTime=2000
6 | syncLimit=2
7 | dynamicConfigFile=zoo.dynamic
8 |
--------------------------------------------------------------------------------
/rdf-delta-examples/Tutorial/zk-example/zk3/zoo.dynamic:
--------------------------------------------------------------------------------
1 | server.1=localhost:2281:3381:participant;2181
2 | server.2=localhost:2282:3382:participant;2182
3 | server.3=localhost:2283:3383:participant;2183
4 |
--------------------------------------------------------------------------------
/rdf-delta-examples/src/main/java/org/seaborne/delta/examples/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.examples;
19 |
20 |
--------------------------------------------------------------------------------
/rdf-delta-examples/src/main/resources/data.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX ex:
4 |
5 | ex:s ex:p ex:o .
6 |
7 | _:b ex:p 1.
8 | _:b ex:p 2.
9 |
--------------------------------------------------------------------------------
/rdf-delta-examples/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/rdf-delta-examples/testing/delta.cfg:
--------------------------------------------------------------------------------
1 | {
2 | "version" : 1 ,
3 | "log_type" : "file"
4 | }
5 |
--------------------------------------------------------------------------------
/rdf-delta-examples/testing/fuseki_conf_1.ttl:
--------------------------------------------------------------------------------
1 | PREFIX : <#>
2 | PREFIX fuseki:
3 | PREFIX rdf:
4 | PREFIX rdfs:
5 | PREFIX ja:
6 | PREFIX delta:
7 |
8 | [] rdf:type fuseki:Server ;
9 | .
10 |
11 | <#service1> rdf:type fuseki:Service ;
12 | fuseki:name "ds1" ;
13 | fuseki:serviceQuery "sparql" ;
14 | fuseki:serviceQuery "query" ;
15 | fuseki:serviceUpdate "update" ;
16 | fuseki:serviceUpload "upload" ;
17 | fuseki:serviceReadWriteGraphStore "data" ;
18 | fuseki:serviceReadGraphStore "get" ;
19 | fuseki:dataset <#dataset> ;
20 | .
21 |
22 | <#dataset> rdf:type delta:DeltaDataset ;
23 | delta:changes "http://localhost:1068/" ;
24 | delta:patchlog "ABC";
25 | # delta:poll or :sync
26 | delta:zone "target/Zone1";
27 | delta:storage "mem";
28 | .
29 |
30 |
31 |
--------------------------------------------------------------------------------
/rdf-delta-examples/testing/fuseki_conf_2.ttl:
--------------------------------------------------------------------------------
1 | PREFIX : <#>
2 | PREFIX fuseki:
3 | PREFIX rdf:
4 | PREFIX rdfs:
5 | PREFIX ja:
6 | PREFIX delta:
7 |
8 | [] rdf:type fuseki:Server ;
9 | .
10 |
11 | <#service1> rdf:type fuseki:Service ;
12 | fuseki:name "ds2" ;
13 | fuseki:serviceQuery "sparql" ;
14 | fuseki:serviceQuery "query" ;
15 | fuseki:serviceUpdate "update" ;
16 | fuseki:serviceUpload "upload" ;
17 | fuseki:serviceReadWriteGraphStore "data" ;
18 | fuseki:serviceReadGraphStore "get" ;
19 | fuseki:dataset <#dataset> ;
20 | .
21 |
22 | <#dataset> rdf:type delta:DeltaDataset ;
23 | delta:changes "http://localhost:1068/" ;
24 | delta:patchlog "ABC";
25 | # delta:poll or :sync
26 | delta:zone "target/Zone2";
27 | delta:storage "mem";
28 | .
29 |
30 |
31 |
--------------------------------------------------------------------------------
/rdf-delta-examples/testing/test_dlink/patch-empty.rdfp:
--------------------------------------------------------------------------------
1 | H id .
2 | TX .
3 | TC.
4 |
--------------------------------------------------------------------------------
/rdf-delta-examples/testing/test_dlink/patch1.rdfp:
--------------------------------------------------------------------------------
1 | H id .
2 | TX .
3 | A .
4 | TC .
5 |
--------------------------------------------------------------------------------
/rdf-delta-examples/testing/test_dlink/patch2.rdfp:
--------------------------------------------------------------------------------
1 | H id .
2 | H prev .
3 | TX .
4 | A .
5 | TC .
6 |
--------------------------------------------------------------------------------
/rdf-delta-examples/testing/test_dlink/patch3.rdfp:
--------------------------------------------------------------------------------
1 | H id .
2 | H prev .
3 | TX .
4 | A .
5 | TC .
6 |
--------------------------------------------------------------------------------
/rdf-delta-examples/testing/test_dlink/patch_bad_1.rdfp:
--------------------------------------------------------------------------------
1 | # No "H id"
2 | TX .
3 | A .
4 | TC .
5 |
--------------------------------------------------------------------------------
/rdf-delta-examples/testing/test_dlink/patch_bad_2.rdfp:
--------------------------------------------------------------------------------
1 | # No "H id"
2 | H PREV .
3 | TX .
4 | A .
5 | TC .
6 |
--------------------------------------------------------------------------------
/rdf-delta-examples/testing/test_dlink/patch_bad_3.rdfp:
--------------------------------------------------------------------------------
1 | # "H id" and H prev are the same.
2 | H ID .
3 | H PREV .
4 | TX .
5 | A .
6 | TC .
7 |
--------------------------------------------------------------------------------
/rdf-delta-fuseki-server/src/main/java/org/seaborne/delta/fuseki/cmd/DeltaFusekiServerCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.fuseki.cmd;
19 |
20 | import org.apache.jena.atlas.lib.FileOps;
21 | import org.apache.jena.fuseki.main.cmds.FusekiMainCmd;
22 | import org.apache.jena.fuseki.system.FusekiLogging;
23 |
24 | public class DeltaFusekiServerCmd {
25 |
26 | public static void main(String[] args) {
27 | // Stop Fuseki trying to initialize logging using log4j.
28 | System.setProperty("log4j.configuration", "delta");
29 | // In case, we are invoked directly, not via dcmd.
30 | String[] log4j2files = { "log4j2.properties", "log4j2.yaml", "log4j2.yml", "log4j2.json", "log4j2.jsn", "log4j2.xml" };
31 | for ( String fn : log4j2files ) {
32 | if ( FileOps.exists(fn) ) {
33 | // Let Log4j2 initialize normally.
34 | System.setProperty("log4j.configurationFile", fn);
35 | break;
36 | }
37 | }
38 | FusekiLogging.markInitialized(true);
39 | FusekiMainCmd.main(args);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/rdf-delta-fuseki/src/main/resources/META-INF/services/org.apache.jena.sys.JenaSubsystemLifecycle:
--------------------------------------------------------------------------------
1 | org.seaborne.delta.fuseki.InitDeltaFuseki
2 |
--------------------------------------------------------------------------------
/rdf-delta-fuseki/src/test/java/org/seaborne/delta/fuseki/TS_DeltaFuseki.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.fuseki;
19 |
20 | import org.junit.BeforeClass;
21 | import org.junit.runner.RunWith;
22 | import org.junit.runners.Suite;
23 | import org.junit.runners.Suite.SuiteClasses;
24 | import org.seaborne.delta.lib.LogX;
25 |
26 | @RunWith(Suite.class)
27 | @SuiteClasses( {
28 | TestPatchFuseki.class
29 | })
30 |
31 | public class TS_DeltaFuseki {
32 | @BeforeClass public static void setForTesting() {
33 | LogX.setJavaLogging("src/test/resources/logging.properties");
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/rdf-delta-fuseki/src/test/resources/logging.properties:
--------------------------------------------------------------------------------
1 | handlers=org.apache.jena.atlas.logging.java.ConsoleHandlerStream
2 | org.apache.jena.atlas.logging.java.ConsoleHandlerStream = ALL
3 | .level = ALL
4 |
5 | ## org.apache.jena.atlas.logging.java.ConsoleHandlerStream.level=INFO
6 | ## org.apache.jena.atlas.logging.java.ConsoleHandlerStdout.formatter = \
7 | ## org.apache.jena.atlas.logging.java.TextFormatter
8 | ## org.apache.jena.atlas.logging.java.TextFormatter.format = \
9 | ## default: %5$tT %3$-5s %2$-20s :: %6$s
10 | ## Full name %1 and milliseconds %5$tL %$
11 | ## date/time : [%5$tF %5$tT]
12 | ## %5$tT.%5$tL %3$-5s %1$-20s :: %6$s
13 |
14 | org.apache.jena.atlas.logging.java.TextFormatter.format = %5$tT %3$-5s %2$-20s : %6$s
15 |
16 | org.seaborne.delta.level = WARNING
17 | Delta.level = WARNING
18 |
19 | org.apache.zookeeper.level = WARNING
20 | org.apache.curator.level = WARNING
21 |
22 | org.apache.jena.level = INFO
23 | org.apache.jena.fuseki.level = WARNING
24 |
25 |
26 | ## Fuseki loggers
27 | # The server setup./configuration log.
28 | org.apache.jena.fuseki.Server.level = OFF
29 | # The action lifecycle log.
30 | org.apache.jena.fuseki.Fuseki.level = WARNING
31 |
32 | # NCSA Format logging.
33 | org.apache.jena.fuseki.Request.level = OFF
34 | org.apache.jena.fuseki.Request.useParentHandlers = false
35 | org.apache.jena.fuseki.Request.handlers = org.apache.jena.atlas.logging.java.FlatHandler
36 |
37 | ## # Others
38 | org.eclipse.jetty.level = WARNING
39 | org.eclipse.jetty.server.level = WARNING
40 | org.eclipse.jetty.util.log.level = WARNING
41 | org.apache.shiro.level = WARNING
42 | org.apache.http.level = INFO
43 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/.gitignore:
--------------------------------------------------------------------------------
1 | /--mem--/
2 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/fuseki-config.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX : <#>
4 | PREFIX fuseki:
5 | PREFIX rdf:
6 | PREFIX rdfs:
7 | PREFIX ja:
8 | PREFIX delta:
9 |
10 | [] rdf:type fuseki:Server ;
11 | .
12 |
13 | <#service1> rdf:type fuseki:Service ;
14 | fuseki:name "%DS_NAME%" ;
15 | fuseki:serviceQuery "sparql" ;
16 | fuseki:serviceQuery "query" ;
17 | fuseki:serviceUpdate "update" ;
18 | fuseki:serviceUpload "upload" ;
19 | fuseki:serviceReadWriteGraphStore "data" ;
20 | fuseki:serviceReadGraphStore "get" ;
21 | fuseki:dataset <#dataset> ;
22 | .
23 |
24 | <#dataset> rdf:type delta:DeltaDataset ;
25 | delta:changes "%LOG_URL%" ;
26 | delta:patchlog "%LOG_NAME%";
27 | delta:zone "%ZONE_NAME%";
28 | delta:storage "mem";
29 | .
30 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TC_DeltaIntegration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.BeforeClass;
21 | import org.junit.runner.RunWith;
22 | import org.junit.runners.Suite;
23 | import org.junit.runners.Suite.SuiteClasses;
24 | import org.seaborne.delta.integration.TS_DeltaZk;
25 | import org.seaborne.delta.lib.LogX;
26 |
27 | @RunWith(Suite.class)
28 | @SuiteClasses( {
29 | TS_Delta.class
30 | , TS_DeltaZk.class
31 | })
32 |
33 | public class TC_DeltaIntegration {
34 | @BeforeClass public static void setForTesting() {
35 | LogX.setJavaLogging("src/test/resources/logging.properties");
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestDeltaLogLockZk.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.AfterClass;
21 | import org.junit.BeforeClass;
22 | import org.seaborne.delta.link.DeltaLink;
23 | import org.seaborne.delta.server.http.DeltaServer;
24 | import org.seaborne.delta.systemtest.Matrix;
25 |
26 | public class TestDeltaLogLockZk extends AbstractTestDeltaLogLock {
27 |
28 | static { TC_DeltaIntegration.setForTesting(); }
29 |
30 | private static DeltaServer deltaServer;
31 | private static DeltaLink dLink;
32 |
33 | @BeforeClass
34 | public static void before() {
35 | Matrix.setup();
36 | dLink = Matrix.deltaServerLink1;
37 | DataSourceDescription dsd = dLink.getDataSourceDescriptionByName("ABC");
38 | dsRef = ( dsd != null ) ? dsd.getId() : dLink.newDataSource("ABC", "http://data/ABC");
39 | }
40 |
41 | @AfterClass
42 | public static void after() {
43 | Matrix.teardown();
44 | }
45 |
46 | @Override
47 | protected DeltaLink getDLink() {
48 | return dLink;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestLocalClient.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 | import org.seaborne.delta.lib.LogX;
25 |
26 | public class TestLocalClient extends AbstractTestDeltaClient {
27 | @BeforeClass public static void setForTesting() {
28 | LogX.setJavaLogging("src/test/resources/logging.properties");
29 | }
30 |
31 | static Setup.LinkSetup setup = Setup.LocalSetup.createFile();
32 |
33 | @Override
34 | public Setup.LinkSetup getSetup() {
35 | return setup;
36 | }
37 |
38 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
39 | @AfterClass public static void afterClass() { setup.afterClass(); }
40 | @Before public void beforeTest() { setup.beforeTest(); }
41 | @After public void afterTest() { setup.afterTest(); }
42 | }
43 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestLocalConnectionFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 |
25 | public class TestLocalConnectionFile extends AbstractTestDeltaConnection {
26 | static Setup.LinkSetup setup = Setup.LocalSetup.createFile();
27 |
28 | @Override
29 | public Setup.LinkSetup getSetup() {
30 | return setup;
31 | }
32 |
33 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
34 | @AfterClass public static void afterClass() { setup.afterClass(); }
35 | @Before public void beforeTest() { setup.beforeTest(); }
36 | @After public void afterTest() { setup.afterTest(); }
37 | }
38 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestLocalConnectionMem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 |
25 | public class TestLocalConnectionMem extends AbstractTestDeltaConnection {
26 | static Setup.LinkSetup setup = Setup.LocalSetup.createMem();
27 |
28 | @Override
29 | public Setup.LinkSetup getSetup() {
30 | return setup;
31 | }
32 |
33 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
34 | @AfterClass public static void afterClass() { setup.afterClass(); }
35 | @Before public void beforeTest() { setup.beforeTest(); }
36 | @After public void afterTest() { setup.afterTest(); }
37 | }
38 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestLocalConnectionRocksDB.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 |
25 | public class TestLocalConnectionRocksDB extends AbstractTestDeltaConnection {
26 | static Setup.LinkSetup setup = Setup.LocalSetup.createRocksDB();
27 |
28 | @Override
29 | public Setup.LinkSetup getSetup() {
30 | return setup;
31 | }
32 |
33 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
34 | @AfterClass public static void afterClass() { setup.afterClass(); }
35 | @Before public void beforeTest() { setup.beforeTest(); }
36 | @After public void afterTest() { setup.afterTest(); }
37 | }
38 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestLocalConnectionZk.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 |
25 | public class TestLocalConnectionZk extends AbstractTestDeltaConnection {
26 | static Setup.LinkSetup setup = Setup.LocalSetup.createZkMem();
27 |
28 | @Override
29 | public Setup.LinkSetup getSetup() {
30 | return setup;
31 | }
32 |
33 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
34 | @AfterClass public static void afterClass() { setup.afterClass(); }
35 | @Before public void beforeTest() { setup.beforeTest(); }
36 | @After public void afterTest() { setup.afterTest(); }
37 | }
38 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestLocalLinkFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 | import org.seaborne.delta.lib.LogX;
25 | import org.seaborne.delta.server.system.DeltaSystem;
26 |
27 | public class TestLocalLinkFile extends AbstractTestDeltaLink {
28 | @BeforeClass public static void setForTesting() {
29 | LogX.setJavaLogging("src/test/resources/logging.properties");
30 | DeltaSystem.init();
31 | }
32 |
33 | static Setup.LinkSetup setup = Setup.LocalSetup.createFile();
34 |
35 | @Override
36 | public Setup.LinkSetup getSetup() {
37 | return setup;
38 | }
39 |
40 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
41 | @AfterClass public static void afterClass() { setup.afterClass(); }
42 | @Before public void beforeTest() { setup.beforeTest(); }
43 | @After public void afterTest() { setup.afterTest(); }
44 | }
45 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestLocalLinkMem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 | import org.seaborne.delta.lib.LogX;
25 | import org.seaborne.delta.server.system.DeltaSystem;
26 |
27 | public class TestLocalLinkMem extends AbstractTestDeltaLink {
28 | @BeforeClass public static void setForTesting() {
29 | LogX.setJavaLogging("src/test/resources/logging.properties");
30 | DeltaSystem.init();
31 | }
32 |
33 | static Setup.LinkSetup setup = Setup.LocalSetup.createMem();
34 |
35 | @Override
36 | public Setup.LinkSetup getSetup() {
37 | return setup;
38 | }
39 |
40 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
41 | @AfterClass public static void afterClass() { setup.afterClass(); }
42 | @Before public void beforeTest() { setup.beforeTest(); }
43 | @After public void afterTest() { setup.afterTest(); }
44 | }
45 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestLocalLinkRocksDB.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 | import org.seaborne.delta.lib.LogX;
25 | import org.seaborne.delta.server.system.DeltaSystem;
26 |
27 | public class TestLocalLinkRocksDB extends AbstractTestDeltaLink {
28 | @BeforeClass public static void setForTesting() {
29 | LogX.setJavaLogging("src/test/resources/logging.properties");
30 | DeltaSystem.init();
31 | }
32 |
33 | static Setup.LinkSetup setup = Setup.LocalSetup.createRocksDB();
34 |
35 | @Override
36 | public Setup.LinkSetup getSetup() {
37 | return setup;
38 | }
39 |
40 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
41 | @AfterClass public static void afterClass() { setup.afterClass(); }
42 | @Before public void beforeTest() { setup.beforeTest(); }
43 | @After public void afterTest() { setup.afterTest(); }
44 | }
45 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestLocalLinkZk.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 | import org.seaborne.delta.lib.LogX;
25 | import org.seaborne.delta.server.system.DeltaSystem;
26 |
27 | public class TestLocalLinkZk extends AbstractTestDeltaLink {
28 | @BeforeClass public static void setForTesting() {
29 | LogX.setJavaLogging("src/test/resources/logging.properties");
30 | DeltaSystem.init();
31 | }
32 |
33 | static Setup.LinkSetup setup = Setup.LocalSetup.createZkMem();
34 |
35 | @Override
36 | public Setup.LinkSetup getSetup() {
37 | return setup;
38 | }
39 |
40 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
41 | @AfterClass public static void afterClass() { setup.afterClass(); }
42 | @Before public void beforeTest() { setup.beforeTest(); }
43 | @After public void afterTest() { setup.afterTest(); }
44 | }
45 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestLogLockZk.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.apache.jena.atlas.web.WebLib;
21 | import org.junit.AfterClass;
22 | import org.junit.BeforeClass;
23 | import org.seaborne.delta.link.DeltaLink;
24 | import org.seaborne.delta.server.http.DeltaServer;
25 | import org.seaborne.delta.systemtest.Matrix;
26 |
27 | public class TestLogLockZk extends AbstractTestLogLock {
28 | private static int PORT = WebLib.choosePort();
29 | private static DeltaServer deltaServer;
30 | private static DeltaLink dLink;
31 |
32 | @BeforeClass
33 | public static void beforeClass() {
34 | Matrix.setup();
35 | dLink = Matrix.deltaServerLink1;
36 | }
37 |
38 | @AfterClass
39 | public static void afterClass() {
40 | Matrix.teardown();
41 | }
42 |
43 | @Override
44 | protected DeltaLink getDLink() {
45 | return dLink;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestReleaseSetup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import static org.junit.Assert.assertFalse;
21 | import static org.junit.Assert.assertTrue;
22 |
23 | import org.junit.Test;
24 | import org.seaborne.delta.server.local.LocalServer;
25 | import org.seaborne.delta.server.local.patchstores.zk.PatchStoreZk;
26 |
27 | public class TestReleaseSetup {
28 | // Check setting for a release.
29 |
30 | @Test
31 | public void deltaZk_setup() {
32 | assertTrue("PatchStoreZk.actionsInWatcher is false", PatchStoreZk.actionsInWatcher);
33 | }
34 |
35 | @Test
36 | public void localServer_setup() {
37 | assertFalse("LocalServer.alwaysSyncPatchStore is true", LocalServer.alwaysSyncPatchStore);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestRemoteClient.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 | import org.seaborne.delta.lib.LogX;
25 |
26 | public class TestRemoteClient extends AbstractTestDeltaClient {
27 | @BeforeClass public static void setForTesting() {
28 | LogX.setJavaLogging("src/test/resources/logging.properties");
29 | }
30 |
31 | static Setup.LinkSetup setup = new Setup.RemoteSetup();
32 |
33 | @Override
34 | public Setup.LinkSetup getSetup() {
35 | return setup;
36 | }
37 |
38 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
39 | @AfterClass public static void afterClass() { setup.afterClass(); }
40 | @Before public void beforeTest() { setup.beforeTest(); }
41 | @After public void afterTest() { setup.afterTest(); }
42 | }
43 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestRemoteConnection.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 |
25 | public class TestRemoteConnection extends AbstractTestDeltaConnection {
26 | static Setup.LinkSetup setup = new Setup.RemoteSetup();
27 |
28 | @Override
29 | public Setup.LinkSetup getSetup() {
30 | return setup;
31 | }
32 |
33 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
34 | @AfterClass public static void afterClass() { setup.afterClass(); }
35 | @Before public void beforeTest() { setup.beforeTest(); }
36 | @After public void afterTest() { setup.afterTest(); }
37 | }
38 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/TestRemoteLink.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta;
19 |
20 | import org.junit.After;
21 | import org.junit.AfterClass;
22 | import org.junit.Before;
23 | import org.junit.BeforeClass;
24 | import org.seaborne.delta.lib.LogX;
25 |
26 | public class TestRemoteLink extends AbstractTestDeltaLink {
27 | @BeforeClass public static void setForTesting() {
28 | LogX.setJavaLogging("src/test/resources/logging.properties");
29 | }
30 |
31 | static Setup.LinkSetup setup = new Setup.RemoteSetup();
32 |
33 | @Override
34 | public Setup.LinkSetup getSetup() {
35 | return setup;
36 | }
37 |
38 | @BeforeClass public static void beforeClass() { setup.beforeClass(); }
39 | @AfterClass public static void afterClass() { setup.afterClass(); }
40 | @Before public void beforeTest() { setup.beforeTest(); }
41 | @After public void afterTest() { setup.afterTest(); }
42 | }
43 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/integration/TS_DeltaZk.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.integration;
19 |
20 | import org.junit.BeforeClass;
21 | import org.junit.runner.RunWith;
22 | import org.junit.runners.Suite;
23 | import org.seaborne.delta.lib.LogX;
24 |
25 | /** System integration tests of the whole system. */
26 | @RunWith(Suite.class)
27 | @Suite.SuiteClasses( {
28 | TestDeltaZk.class
29 | , TestDeltaZkFuseki.class
30 | , TestZkExtra.class
31 | })
32 |
33 | public class TS_DeltaZk {
34 | @BeforeClass public static void beforeClass() {
35 | LogX.setJavaLogging("src/test/resources/logging.properties");
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/src/test/java/org/seaborne/delta/integration/TestZkExtra.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.integration;
19 |
20 | import org.junit.*;
21 | import org.seaborne.delta.Id;
22 | import org.seaborne.delta.link.DeltaLink;
23 | import org.seaborne.delta.systemtest.Matrix;
24 |
25 | /** Additional tests for Zookeeper based RDF Delta */
26 | public class TestZkExtra {
27 |
28 | @BeforeClass public static void beforeClass() {}
29 | @AfterClass public static void afterClass() {}
30 |
31 | @Before public void before() { Matrix.setup(); }
32 | @After public void after() { Matrix.teardown(); }
33 |
34 | @Test public void twoLinks() {
35 | DeltaLink dLink1 = Matrix.deltaServerLink1;
36 | DeltaLink dLink2 = Matrix.deltaServerLink2;
37 |
38 | Id dsRef1 = dLink1.newDataSource("ABC01", "http://example/ABC01");
39 | dLink1.removeDataSource(dsRef1);
40 |
41 |
42 | Id dsRef2 = dLink1.newDataSource("ABC02", "http://example/ABC02");
43 | dLink1.removeDataSource(dsRef2);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/assembler/delta-assembler-ext-bad-1.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX :
4 | PREFIX tdb:
5 | PREFIX tdb2:
6 | PREFIX rdf:
7 | PREFIX ja:
8 | PREFIX rdfs:
9 | PREFIX delta:
10 |
11 | :deltaDataset rdf:type delta:DeltaDataset ;
12 | delta:changes "http://localhost:1069/" ;
13 | delta:patchlog "ABC";
14 | delta:zone "--mem--";
15 | # No delta:storage, no delta:dataset.
16 | .
17 |
18 | :dataset rdf:type ja:MemoryDataset .
19 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/assembler/delta-assembler-ext-bad-2.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX :
4 | PREFIX tdb:
5 | PREFIX tdb2:
6 | PREFIX rdf:
7 | PREFIX ja:
8 | PREFIX rdfs:
9 | PREFIX delta:
10 |
11 | :deltaDataset rdf:type delta:DeltaDataset ;
12 | delta:changes "http://localhost:1069/" ;
13 | delta:patchlog "ABC" ;
14 | delta:zone "--mem--" ;
15 | ## delta:dataset but delta:storage != external
16 | delta:dataset :dataset ;
17 | delta:storage "mem" ;
18 | .
19 |
20 | :dataset rdf:type ja:MemoryDataset .
21 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/assembler/delta-assembler-ext-bad-3.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX :
4 | PREFIX tdb:
5 | PREFIX tdb2:
6 | PREFIX rdf:
7 | PREFIX ja:
8 | PREFIX rdfs:
9 | PREFIX delta:
10 |
11 | :deltaDataset rdf:type delta:DeltaDataset ;
12 | delta:changes "http://localhost:1069/" ;
13 | delta:patchlog "ABC" ;
14 | delta:zone "--mem--" ;
15 | # delta:storage = "external" but no delta:dataset.
16 | delta:storage "external" ;
17 | .
18 |
19 | :dataset rdf:type ja:MemoryDataset .
20 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/assembler/delta-assembler-ext-good-1.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX :
4 | PREFIX tdb:
5 | PREFIX tdb2:
6 | PREFIX rdf:
7 | PREFIX ja:
8 | PREFIX rdfs:
9 | PREFIX delta:
10 |
11 | :deltaDataset rdf:type delta:DeltaDataset ;
12 | delta:changes "http://localhost:1069/" ;
13 | delta:patchlog "ABC";
14 | delta:zone "--mem--";
15 | delta:dataset :dataset ;
16 | .
17 |
18 | :dataset rdf:type ja:MemoryDataset .
19 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/assembler/delta-assembler-ext-good-2.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX :
4 | PREFIX tdb:
5 | PREFIX tdb2:
6 | PREFIX rdf:
7 | PREFIX ja:
8 | PREFIX rdfs:
9 | PREFIX delta:
10 |
11 | :deltaDataset rdf:type delta:DeltaDataset ;
12 | delta:changes "http://localhost:1069/" ;
13 | delta:patchlog "ABC" ;
14 | delta:zone "--mem--" ;
15 | delta:storage "external" ;
16 | delta:dataset :dataset ;
17 | .
18 |
19 | :dataset rdf:type ja:MemoryDataset .
20 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/assembler/delta-dataset-mem.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX : <#>
4 | PREFIX rdf:
5 | PREFIX rdfs:
6 | PREFIX ja:
7 | PREFIX delta:
8 |
9 | <#dataset> rdf:type delta:DeltaDataset ;
10 | delta:changes "http://localhost:1069/" ;
11 | delta:patchlog "A-mem";
12 | delta:zone "target/Zone1";
13 | delta:storage "mem";
14 | .
15 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/assembler/delta-dataset-tdb1.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX : <#>
4 | PREFIX rdf:
5 | PREFIX rdfs:
6 | PREFIX ja:
7 | PREFIX delta:
8 |
9 | <#dataset> rdf:type delta:DeltaDataset ;
10 | delta:changes "http://localhost:1069/" ;
11 | delta:patchlog "A-tdb1";
12 | delta:zone "target/Zone3";
13 | delta:storage "TDB";
14 | .
15 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/assembler/delta-dataset-tdb2.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX : <#>
4 | PREFIX rdf:
5 | PREFIX rdfs:
6 | PREFIX ja:
7 | PREFIX delta:
8 |
9 | <#dataset> rdf:type delta:DeltaDataset ;
10 | delta:changes "http://localhost:1069/" ;
11 | delta:patchlog "A-tdb2";
12 | delta:zone "target/Zone2";
13 | delta:storage "TDB2";
14 | .
15 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/data.rdfp:
--------------------------------------------------------------------------------
1 | # Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 | H id .
3 | TB .
4 | PA "rdf" .
5 | PD "rdf" .
6 | A .
7 | D .
8 | TC.
9 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/delta.cfg:
--------------------------------------------------------------------------------
1 | {
2 | "version" : 1 ,
3 | "log_type" : "file"
4 | "store" : "directory name"
5 | }
6 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/fuseki/fuseki-assembler-ext.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX :
4 | PREFIX tdb:
5 | PREFIX tdb2:
6 | PREFIX rdf:
7 | PREFIX ja:
8 | PREFIX rdfs:
9 | PREFIX fuseki:
10 | PREFIX delta:
11 |
12 | :service a fuseki:Service ;
13 | rdfs:label "TDB ds" ;
14 | fuseki:name "ds" ;
15 | fuseki:endpoint [ fuseki:operation fuseki:query ] ;
16 | fuseki:endpoint [ fuseki:operation fuseki:update ] ;
17 | fuseki:dataset :deltaDataset ;
18 | .
19 |
20 | :deltaDataset rdf:type delta:DeltaDataset ;
21 | delta:changes "http://localhost:1077/" ;
22 | delta:patchlog "ABC";
23 | delta:zone "--mem--";
24 | delta:dataset :dataset ;
25 | .
26 |
27 | :dataset rdf:type ja:MemoryDataset .
28 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/fuseki/fuseki_conf_1.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX : <#>
4 | PREFIX fuseki:
5 | PREFIX rdf:
6 | PREFIX rdfs:
7 | PREFIX ja:
8 | PREFIX delta:
9 |
10 | [] rdf:type fuseki:Server ;
11 | .
12 |
13 | <#service1> rdf:type fuseki:Service ;
14 | fuseki:name "ds1" ;
15 | fuseki:serviceQuery "sparql" ;
16 | fuseki:serviceQuery "query" ;
17 | fuseki:serviceUpdate "update" ;
18 | fuseki:serviceUpload "upload" ;
19 | fuseki:serviceReadWriteGraphStore "data" ;
20 | fuseki:serviceReadGraphStore "get" ;
21 | fuseki:dataset <#dataset> ;
22 | .
23 |
24 | <#dataset> rdf:type delta:DeltaDataset ;
25 | delta:changes "http://localhost:%D_PORT%/" ;
26 | delta:patchlog "ABC";
27 | # delta:poll or :sync
28 | delta:zone "target/Zone1";
29 | delta:storage "mem";
30 | .
31 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/fuseki/fuseki_conf_2.ttl:
--------------------------------------------------------------------------------
1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
2 |
3 | PREFIX : <#>
4 | PREFIX fuseki:
5 | PREFIX rdf:
6 | PREFIX rdfs:
7 | PREFIX ja:
8 | PREFIX delta:
9 |
10 | [] rdf:type fuseki:Server ;
11 | .
12 |
13 | <#service1> rdf:type fuseki:Service ;
14 | fuseki:name "ds2" ;
15 | fuseki:serviceQuery "sparql" ;
16 | fuseki:serviceQuery "query" ;
17 | fuseki:serviceUpdate "update" ;
18 | fuseki:serviceUpload "upload" ;
19 | fuseki:serviceReadWriteGraphStore "data" ;
20 | fuseki:serviceReadGraphStore "get" ;
21 | fuseki:dataset <#dataset> ;
22 | .
23 |
24 | <#dataset> rdf:type delta:DeltaDataset ;
25 | delta:changes "http://localhost:%D_PORT%/" ;
26 | delta:patchlog "ABC";
27 | # delta:poll or :sync
28 | delta:zone "target/Zone2";
29 | delta:storage "mem";
30 | .
31 |
32 |
33 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/test_dlink/patch-empty.rdfp:
--------------------------------------------------------------------------------
1 | H id .
2 | TX .
3 | TC.
4 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/test_dlink/patch-graph.rdfp:
--------------------------------------------------------------------------------
1 | H id .
2 | TX .
3 | # Triple
4 | A .
5 | TC .
6 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/test_dlink/patch1.rdfp:
--------------------------------------------------------------------------------
1 | H id .
2 | TX .
3 | A .
4 | TC .
5 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/test_dlink/patch2.rdfp:
--------------------------------------------------------------------------------
1 | H id .
2 | H prev .
3 | TX .
4 | A .
5 | TC .
6 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/test_dlink/patch3.rdfp:
--------------------------------------------------------------------------------
1 | H id .
2 | H prev .
3 | TX .
4 | A .
5 | TC .
6 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/test_dlink/patch_bad_1.rdfp:
--------------------------------------------------------------------------------
1 | # No "H id"
2 | TX .
3 | A .
4 | TC .
5 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/test_dlink/patch_bad_2.rdfp:
--------------------------------------------------------------------------------
1 | # No "H id"
2 | H PREV .
3 | TX .
4 | A .
5 | TC .
6 |
--------------------------------------------------------------------------------
/rdf-delta-integration-tests/testing/test_dlink/patch_bad_3.rdfp:
--------------------------------------------------------------------------------
1 | # "H id" and H prev are the same.
2 | H ID .
3 | H PREV .
4 | TX .
5 | A .
6 | TC .
7 |
--------------------------------------------------------------------------------
/rdf-delta-server-extra/src/main/java/org/seaborne/delta/server/s3/InitDeltaZkS3.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.s3;
19 |
20 | import org.seaborne.delta.server.system.DeltaSubsystemLifecycle;
21 | import org.seaborne.delta.server.system.DeltaSystem;
22 |
23 | public class InitDeltaZkS3 implements DeltaSubsystemLifecycle {
24 | @Override
25 | public void start() {
26 | DeltaSystem.logLifecycle("InitDeltaZkS3 - start");
27 | InitZkS3.register();
28 | DeltaSystem.logLifecycle("InitDeltaZkS3 - finish");
29 | }
30 |
31 | @Override
32 | public void stop() {}
33 |
34 | // After InitDeltaServerLocalLast
35 | @Override
36 | public int level() { return 9100; }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/rdf-delta-server-extra/src/main/java/org/seaborne/delta/server/s3/InitZkS3.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.s3;
19 |
20 | import org.seaborne.delta.server.local.PatchStoreMgr;
21 | import org.seaborne.delta.server.local.PatchStoreProvider;
22 |
23 | public class InitZkS3 {
24 |
25 | public static void register() {
26 | PatchStoreProvider psp = new PatchStoreProviderZkS3();
27 | PatchStoreMgr.register(psp);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/rdf-delta-server-extra/src/main/resources/META-INF/services/org.seaborne.delta.server.system.DeltaSubsystemLifecycle:
--------------------------------------------------------------------------------
1 | org.seaborne.delta.server.s3.InitDeltaZkS3
2 |
--------------------------------------------------------------------------------
/rdf-delta-server-extra/src/test/java/org/seaborne/delta/server/s3/TS_ServerExtra.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.s3;
19 |
20 | import org.junit.BeforeClass;
21 | import org.junit.runner.RunWith;
22 | import org.junit.runners.Suite;
23 | import org.seaborne.delta.lib.LogX;
24 |
25 | @RunWith(Suite.class)
26 | @Suite.SuiteClasses( {
27 | TestPatchStorageS3.class
28 | , TestPatchLogZkS3.class
29 | , TestPatchStoreZkS3.class
30 | })
31 |
32 | public class TS_ServerExtra {
33 | @BeforeClass public static void beforeClass() {
34 | LogX.setJavaLogging("src/test/resources/logging.properties");
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/rdf-delta-server-http/src/main/java/org/seaborne/delta/server/http/S_Ping.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.http;
19 |
20 | import jakarta.servlet.http.HttpServletRequest;
21 |
22 | import org.apache.jena.atlas.json.JsonValue ;
23 | import org.seaborne.delta.DeltaLib;
24 |
25 | /** Respond with a ping as a JSON object */
26 | public class S_Ping extends S_ReplyJSON {
27 | public S_Ping() { }
28 |
29 | @Override
30 | protected JsonValue json(HttpServletRequest req) { return DeltaLib.ping() ; }
31 | }
32 |
--------------------------------------------------------------------------------
/rdf-delta-server-http/src/main/java/org/seaborne/delta/server/http/S_Restart.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.http;
19 |
20 | import java.io.IOException ;
21 |
22 | import jakarta.servlet.http.HttpServlet;
23 | import jakarta.servlet.http.HttpServletRequest ;
24 | import jakarta.servlet.http.HttpServletResponse ;
25 |
26 | import org.apache.jena.web.HttpSC ;
27 | import org.seaborne.delta.Delta ;
28 | import org.slf4j.Logger ;
29 |
30 | public class S_Restart extends HttpServlet {
31 | static private Logger LOG = Delta.DELTA_LOG ;
32 |
33 | public S_Restart() { }
34 |
35 | @Override
36 | protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
37 | LOG.info("** Restart ** (currently a no-op)");
38 | resp.setStatus(HttpSC.NO_CONTENT_204) ;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/rdf-delta-server-http/src/main/java/org/seaborne/delta/server/http/ServerLib.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.http;
19 |
20 | import jakarta.servlet.http.HttpServletRequest;
21 |
22 | public class ServerLib {
23 | /** URL string, including query string */
24 | public static String url(HttpServletRequest request) {
25 | if ( request.getQueryString() == null )
26 | return request.getRequestURI();
27 | return request.getRequestURI()+"?"+request.getQueryString();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/rdf-delta-server-http/src/main/java/org/seaborne/delta/server/http/ZkMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.http;
19 |
20 | public enum ZkMode { NONE, EXTERNAL, LOCAL, QUORUM, MEM }
--------------------------------------------------------------------------------
/rdf-delta-server-http/src/main/resources/META-INF/NOTICE:
--------------------------------------------------------------------------------
1 | RDF Delta
2 | =========
3 |
4 | Copyright 2013, 2014, 2015, 2016 Andy Seaborne
5 | Copyright 2016 TopQuadrant Inc.
6 |
7 | Portions of this software derive from Apache Jena.
8 |
--------------------------------------------------------------------------------
/rdf-delta-server-http/src/test/java/org/seaborne/delta/server/http/TS_ServerHTTP.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.http;
19 |
20 | import org.junit.runner.RunWith ;
21 | import org.junit.runners.Suite ;
22 |
23 | @RunWith(Suite.class)
24 | @Suite.SuiteClasses( {
25 | TestURLParsing.class
26 | })
27 |
28 | // Most testing happens in the integration test package "rdf-delta-test"
29 | // because that has access to the client side. As the servlets are little more
30 | // routing/rewriting operation from the DeltaLinkHTTP requests comign in to
31 | // DeltaLinkLocal operations there i no a lot of testing that can be done here.
32 |
33 | public class TS_ServerHTTP {
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/rdf-delta-server-http/src/test/java/org/seaborne/delta/server/http/TestURLParsing.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.http;
19 |
20 | import org.junit.Test ;
21 |
22 | public class TestURLParsing {
23 | @Test public void testDummy() {}
24 | }
25 |
--------------------------------------------------------------------------------
/rdf-delta-server-http/src/test/resources/logging.properties:
--------------------------------------------------------------------------------
1 | handlers=org.apache.jena.atlas.logging.java.ConsoleHandlerStream
2 | org.apache.jena.atlas.logging.java.ConsoleHandlerStream = ALL
3 | .level = ALL
4 |
5 | ## org.apache.jena.atlas.logging.java.ConsoleHandlerStream.level=INFO
6 | ## org.apache.jena.atlas.logging.java.ConsoleHandlerStdout.formatter = \
7 | ## org.apache.jena.atlas.logging.java.TextFormatter
8 | ## org.apache.jena.atlas.logging.java.TextFormatter.format = \
9 | ## default: %5$tT %3$-5s %2$-20s :: %6$s
10 | ## Full name %1 and milliseconds %5$tL %$
11 | ## date/time : [%5$tF %5$tT]
12 | ## %5$tT.%5$tL %3$-5s %1$-20s :: %6$s
13 |
14 | org.apache.jena.atlas.logging.java.TextFormatter.format = %5$tT %3$-5s %2$-20s : %6$s
15 |
16 | org.seaborne.delta.level = WARNING
17 | Delta.level = WARNING
18 |
19 | org.apache.zookeeper.level = WARNING
20 | org.apache.curator.level = WARNING
21 |
22 | org.apache.jena.level = INFO
23 | org.apache.jena.fuseki.level = WARNING
24 |
25 |
26 | ## Fuseki loggers
27 | # The server setup./configuration log.
28 | org.apache.jena.fuseki.Server.level=OFF
29 | # The action lifecycle log.
30 | org.apache.jena.fuseki.Fuseki.level=INFO
31 |
32 | # NCSA Format logging.
33 | org.apache.jena.fuseki.Request.level = OFF
34 | org.apache.jena.fuseki.Request.useParentHandlers = false
35 | org.apache.jena.fuseki.Request.handlers = org.apache.jena.atlas.logging.java.FlatHandler
36 |
37 | ## # Others
38 | org.eclipse.jetty.level = WARNING
39 | org.eclipse.jetty.server.level = WARNING
40 | org.eclipse.jetty.util.log.level = WARNING
41 | org.apache.shiro.level = WARNING
42 | org.apache.http.level = INFO
43 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/Provider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server;
19 |
20 | import org.seaborne.delta.DeltaException;
21 |
22 | public enum Provider {
23 | UNSET, MEM, FILE, ROCKS, ZKS3, ZKZK, LOCAL;
24 |
25 | public static Provider create(String str) {
26 | if ( UNSET.name().equalsIgnoreCase(str) ) return UNSET;
27 | if ( MEM.name().equalsIgnoreCase(str) ) return MEM;
28 | if ( FILE.name().equalsIgnoreCase(str) ) return FILE;
29 | if ( ROCKS.name().equalsIgnoreCase(str) ) return ROCKS;
30 | if ( "rdb".equalsIgnoreCase(str) ) return ROCKS;
31 | if ( ZKZK.name().equalsIgnoreCase(str) ) return ZKZK;
32 | if ( ZKS3.name().equalsIgnoreCase(str) ) return ZKS3;
33 | if ( LOCAL.name().equalsIgnoreCase(str) ) return LOCAL;
34 | throw new DeltaException("Provider name '"+str+"'not recognized");
35 | }
36 | }
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/InitDeltaServerLocalFirst.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local;
19 |
20 | import org.seaborne.delta.server.system.DeltaSubsystemLifecycle ;
21 | import org.seaborne.delta.server.system.DeltaSystem ;
22 |
23 | public class InitDeltaServerLocalFirst implements DeltaSubsystemLifecycle {
24 |
25 | @Override
26 | public void start() {
27 | DeltaSystem.logLifecycle("InitDeltaServerLocalFirst - start");
28 | DPS.initFirst();
29 | DeltaSystem.logLifecycle("InitDeltaServerLocalFirst - finish");
30 | }
31 |
32 | @Override
33 | public void stop() {}
34 |
35 | // Make this the first service init so last inits can have a setup system.
36 | @Override
37 | public int level() { return 1 ; }
38 | }
39 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/InitDeltaServerLocalLast.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local;
19 |
20 | import org.seaborne.delta.server.system.DeltaSubsystemLifecycle ;
21 | import org.seaborne.delta.server.system.DeltaSystem ;
22 |
23 | public class InitDeltaServerLocalLast implements DeltaSubsystemLifecycle {
24 |
25 | @Override
26 | public void start() {
27 | DeltaSystem.logLifecycle("InitDeltaServerLocalLast - start");
28 | DPS.initLast();
29 | DeltaSystem.logLifecycle("InitDeltaServerLocalLast - finish");
30 | }
31 |
32 | @Override
33 | public void stop() {}
34 |
35 | // Make this late (but before extras like ZkS3)
36 | // so DPS can do setup all normal registrations.
37 | @Override
38 | public int level() { return 9000 ; }
39 | }
40 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/PatchHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local;
19 |
20 | public interface PatchHandler {
21 | void handle(Patch patch) ;
22 | }
23 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/PatchStoreProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local;
19 |
20 | import org.seaborne.delta.server.Provider;
21 |
22 | /** The provider (factory) of {@link PatchStore} implementations.
23 | * These are added to {@link PatchStoreMgr}.
24 | * There will be only one object of each {@code PatchStoreProvider}.
25 | */
26 | public interface PatchStoreProvider {
27 |
28 | /**
29 | * Create the {@link PatchStore} object for this process.
30 | * Return null to signal the implementation is not available.
31 | * This should boot itself to be able to report existing {@link PatchLog PatchLogs}.
32 | */
33 | public PatchStore create(LocalServerConfig config);
34 |
35 | public Provider getType();
36 |
37 | /** Short name used in server configuration files to set the default provider via "log_type" */
38 | public String getShortName();
39 | }
40 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/handlers/PHandlerLocalDB.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.handlers;
19 |
20 | import org.apache.jena.sparql.core.DatasetGraph ;
21 | import org.seaborne.delta.server.local.Patch;
22 | import org.seaborne.delta.server.local.PatchHandler;
23 | import org.apache.jena.rdfpatch.RDFChanges ;
24 | import org.apache.jena.rdfpatch.changes.RDFChangesApply ;
25 |
26 | /** Write a patch to a {@link DatasetGraph}. */
27 | public class PHandlerLocalDB implements PatchHandler {
28 |
29 | private final DatasetGraph dsg ;
30 |
31 | public PHandlerLocalDB(DatasetGraph dsg) {
32 | this.dsg = dsg ;
33 | }
34 |
35 | @Override
36 | public void handle(Patch patch) {
37 | RDFChanges changes = new RDFChangesApply(dsg) ;
38 | patch.play(changes);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/handlers/PHandlerLog.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.handlers;
19 |
20 | import org.apache.jena.atlas.logging.FmtLog ;
21 | import org.seaborne.delta.server.local.Patch;
22 | import org.seaborne.delta.server.local.PatchHandler;
23 | import org.apache.jena.rdfpatch.RDFPatchOps;
24 | import org.apache.jena.rdfpatch.changes.PatchSummary;
25 | import org.slf4j.Logger ;
26 |
27 | /** Log a infroamtion about a patch */
28 | public class PHandlerLog implements PatchHandler {
29 |
30 | private final Logger log ;
31 |
32 | public PHandlerLog(Logger log) {
33 | this.log = log ;
34 | }
35 |
36 | /** Safe handler */
37 | @Override
38 | public void handle(Patch patch) {
39 |
40 | PatchSummary scc = RDFPatchOps.summary(patch) ;
41 | FmtLog.info(log,
42 | "Patch: Quads: add=%d, delete=%d :: Prefixes: add=%d delete=%d",
43 | scc.countAddData, scc.countDeleteData,
44 | scc.countAddPrefix, scc.countDeletePrefix) ;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/handlers/PHandlerOutput.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.handlers;
19 |
20 | import java.io.OutputStream ;
21 |
22 | import org.seaborne.delta.DeltaOps ;
23 | import org.seaborne.delta.server.local.Patch;
24 | import org.seaborne.delta.server.local.PatchHandler;
25 | import org.apache.jena.rdfpatch.text.RDFChangesWriterText;
26 | import org.apache.jena.rdfpatch.text.TokenWriter ;
27 |
28 | /** Write a patch to an {@code OutputStream}. */
29 | public class PHandlerOutput implements PatchHandler {
30 |
31 | private final RDFChangesWriterText scWriter ;
32 |
33 | public PHandlerOutput(OutputStream output) {
34 | TokenWriter tokenWriter = DeltaOps.tokenWriter(output) ;
35 | scWriter = new RDFChangesWriterText(tokenWriter) ;
36 | }
37 |
38 | @Override
39 | synchronized
40 | public void handle(Patch patch) {
41 | scWriter.start() ;
42 | patch.play(scWriter);
43 | scWriter.finish() ;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/handlers/PHandlerSPARQLUpdateOutput.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.handlers;
19 |
20 | import org.apache.jena.atlas.io.IndentedWriter ;
21 | import org.seaborne.delta.server.local.Patch;
22 | import org.seaborne.delta.server.local.PatchHandler;
23 | import org.apache.jena.rdfpatch.RDFChanges ;
24 | import org.apache.jena.rdfpatch.changes.RDFChangesWriteUpdate ;
25 |
26 | /** Convert a patch to SPARQL Update and output to the console */
27 | public class PHandlerSPARQLUpdateOutput implements PatchHandler {
28 | public PHandlerSPARQLUpdateOutput() {}
29 |
30 | @Override
31 | public void handle(Patch patch) {
32 | IndentedWriter x = new IndentedWriter(System.out) ;
33 | x.setLineNumbers(true);
34 | x.setLinePrefix("GSP>> ");
35 | RDFChanges scData = new RDFChangesWriteUpdate(x) ;
36 | patch.play(scData);
37 | x.flush();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/patchstores/FileNames.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.patchstores;
19 |
20 | /** File names for the file-based patch store provider. */
21 | public class FileNames {
22 | /** Name for the DataSource configuration file for the file-based provider. */
23 | public static final String DS_CONFIG = "source.cfg";
24 |
25 | /** Marker file for "deletes" data sources (they are only hidden) */
26 | public static final String DISABLED = "disabled";
27 | }
28 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/patchstores/any/LocalUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.patchstores.any;
19 |
20 | import java.io.IOException;
21 | import java.nio.file.Files;
22 | import java.nio.file.Path;
23 |
24 | import org.seaborne.delta.server.local.PatchLog;
25 |
26 | /** Operations on "local" patch store - ones stored in the file system */
27 | public class LocalUtils {
28 |
29 | public static void movePatchLog(PatchLog log, Path src, Path dst) {
30 |
31 |
32 |
33 | src = src.toAbsolutePath();
34 | dst = dst.toAbsolutePath();
35 |
36 | // close open.
37 |
38 | if ( ! Files.exists(src) ) {}
39 | if ( Files.exists(dst) ) {}
40 |
41 | try {
42 | Files.move(src, dst);
43 | } catch (IOException e) {
44 | e.printStackTrace();
45 | }
46 |
47 | // fix up source.cfg.
48 |
49 | // Open new.
50 |
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/patchstores/file/PatchLogIndexFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.patchstores.file;
19 |
20 | import org.seaborne.delta.server.local.patchstores.PatchLogIndexBase;
21 |
22 | public class PatchLogIndexFile extends PatchLogIndexBase {
23 |
24 | public PatchLogIndexFile(LogIndexFile logIndexFile) {
25 | super(logIndexFile);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/patchstores/mem/PatchLogIndexMem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.patchstores.mem;
19 |
20 | import org.seaborne.delta.server.local.patchstores.PatchLogIndex;
21 | import org.seaborne.delta.server.local.patchstores.PatchLogIndexBase;
22 |
23 | /** {@link PatchLogIndex} in memory. */
24 | public class PatchLogIndexMem extends PatchLogIndexBase {
25 |
26 | public PatchLogIndexMem() {
27 | super(new LogIndexMem());
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/patchstores/mem/PatchStoreProviderMem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.patchstores.mem;
19 |
20 | import org.seaborne.delta.server.Provider;
21 | import org.seaborne.delta.server.local.DPS;
22 | import org.seaborne.delta.server.local.LocalServerConfig;
23 | import org.seaborne.delta.server.local.PatchStore;
24 | import org.seaborne.delta.server.local.PatchStoreProvider;
25 |
26 | public class PatchStoreProviderMem implements PatchStoreProvider {
27 |
28 | @Override
29 | public PatchStore create(LocalServerConfig config) {
30 | return new PatchStoreMem(this);
31 | }
32 |
33 | @Override
34 | public Provider getType() { return Provider.MEM; }
35 |
36 | @Override
37 | public String getShortName() {
38 | return DPS.pspMem;
39 | }
40 | }
41 |
42 |
43 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/patchstores/rdb/PatchLogIndexRocks.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.patchstores.rdb;
19 |
20 | import org.seaborne.delta.server.local.patchstores.PatchLogIndexBase;
21 |
22 | public class PatchLogIndexRocks extends PatchLogIndexBase {
23 |
24 | public PatchLogIndexRocks(LogIndexRocks logIndex) {
25 | super(logIndex);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/local/patchstores/rdb/RocksConst.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.local.patchstores.rdb;
19 |
20 | import static org.apache.jena.atlas.lib.StrUtils.asUTF8bytes;
21 |
22 | public class RocksConst {
23 |
24 | public static final String databaseFilename = "rdb";
25 |
26 | public static final String CF_VERSION_ID = "versionToId";
27 | public static final String CF_ID_ENTRY = "idToLogEntry";
28 | public static final String CF_PATCH = "patchStorage";
29 |
30 | public static final byte[] B_CF_VERSION_ID = asUTF8bytes(CF_VERSION_ID);
31 | public static final byte[] B_CF_ID_ENTRY = asUTF8bytes(CF_ID_ENTRY);
32 | public static final byte[] B_CF_PATCH = asUTF8bytes(CF_PATCH);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/system/DeltaInitLevel1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.system;
19 |
20 | import org.seaborne.delta.Delta ;
21 | import org.slf4j.Logger ;
22 |
23 | public class DeltaInitLevel1 implements DeltaSubsystemLifecycle {
24 | private Logger log = Delta.DELTA_LOG;
25 | @Override
26 | public void start() {
27 | log.debug("Delta initialization (level 1)");
28 | }
29 |
30 | @Override
31 | public void stop() {
32 | log.debug("Delta shutdown (level 1)");
33 | }
34 |
35 | @Override
36 | public int level() {
37 | return 1;
38 | }
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/system/DeltaSubsystemLifecycle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.system;
19 |
20 | /** Lifecycle interface for subsystems. */
21 | public interface DeltaSubsystemLifecycle extends SubsystemLifecycle {}
22 |
23 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/system/JenaInitHook.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.system;
19 |
20 | import org.apache.jena.sys.JenaSubsystemLifecycle ;
21 | import org.apache.jena.sys.JenaSystem ;
22 |
23 | /** If you want to trigger Delta init for Jena initialization ...
24 | * name this is META-INF/services/org.apache.jena.system.JenaSubsystemLifecycle
25 | * (not normally done this way - can also happen in {@code InitJenaDeltaServerLocal})
26 | */
27 | public class JenaInitHook implements JenaSubsystemLifecycle {
28 |
29 | @Override
30 | public void start() {
31 | boolean original = DeltaSystem.DEBUG_INIT;
32 | DeltaSystem.DEBUG_INIT = DeltaSystem.DEBUG_INIT | JenaSystem.DEBUG_INIT;
33 | //DeltaSystem.init();
34 | DeltaSystem.DEBUG_INIT = original;
35 | }
36 |
37 | @Override
38 | public void stop() {}
39 |
40 | @Override
41 | public int level() {
42 | // Jena level
43 | return 9000;
44 | }
45 | }
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/server/system/SubsystemLifecycle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.system;
19 |
20 | /** Lifecycle interface for subsystems. */
21 | public interface SubsystemLifecycle {
22 |
23 | /** start - a module should be ready to operate when this returns */
24 | public void start() ;
25 |
26 | /** stop - a module should have preformed any shutdown operations by the time this returns */
27 | public void stop() ;
28 |
29 | /** Provide a marker as to the level to order initialization, 10,20,30,...
30 | * See {@link Initializer} for details.
31 | */
32 | default public int level() { return 9999 ; }
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/java/org/seaborne/delta/zk/ZkException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.zk;
19 |
20 | import org.seaborne.delta.DeltaException;
21 |
22 | public class ZkException extends DeltaException {
23 | // public ZkException() { super() ; }
24 | // public ZkException(String msg) { super(msg) ; }
25 | // public ZkException(Throwable th) { super(th) ; }
26 | public ZkException(String msg, Throwable th) { super(msg, th) ; }
27 | }
28 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/resources/META-INF/NOTICE:
--------------------------------------------------------------------------------
1 | RDF Delta
2 | =========
3 |
4 | Copyright 2013, 2014, 2015, 2016 Andy Seaborne
5 | Copyright 2016 TopQuadrant Inc.
6 |
7 | Portions of this software derive from Apache Jena.
8 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/resources/META-INF/services/org.apache.jena.sys.JenaSubsystemLifecycle:
--------------------------------------------------------------------------------
1 | org.seaborne.delta.server.local.InitJenaDeltaServerLocal
2 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/main/resources/META-INF/services/org.seaborne.delta.server.system.DeltaSubsystemLifecycle:
--------------------------------------------------------------------------------
1 | org.seaborne.delta.server.system.DeltaInitLevel1
2 | org.seaborne.delta.server.local.InitDeltaServerLocalFirst
3 | org.seaborne.delta.server.local.InitDeltaServerLocalLast
4 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/test/java/org/seaborne/delta/server/patchstores/TestPatchLogIndexMem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.patchstores;
19 |
20 | import org.seaborne.delta.server.local.patchstores.PatchLogIndex;
21 | import org.seaborne.delta.server.local.patchstores.mem.PatchLogIndexMem;
22 |
23 | public class TestPatchLogIndexMem extends AbstractTestPatchLogIndex {
24 |
25 | @Override
26 | protected PatchLogIndex patchLogIndex() {
27 | return new PatchLogIndexMem();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/test/java/org/seaborne/delta/server/patchstores/TestPatchLogMem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.patchstores;
19 |
20 | import org.seaborne.delta.DataSourceDescription;
21 | import org.seaborne.delta.Id;
22 | import org.seaborne.delta.server.local.*;
23 | import org.seaborne.delta.server.local.patchstores.mem.PatchStoreProviderMem;
24 |
25 | public class TestPatchLogMem extends AbstractTestPatchLog {
26 |
27 | @Override
28 | protected PatchLog patchLog() {
29 | DataSourceDescription dsd = new DataSourceDescription(Id.create(), "ABC", "http://test/ABC");
30 | PatchStoreProvider psp = new PatchStoreProviderMem();
31 | LocalServerConfig config = LocalServers.configMem();
32 | PatchStore patchStore = psp.create(config);
33 | patchStore.initialize(new DataSourceRegistry("mem"), config);
34 | return patchStore.createLog(dsd);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/test/java/org/seaborne/delta/server/patchstores/TestPatchStorageMem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.patchstores;
19 |
20 | import org.seaborne.delta.server.local.patchstores.PatchStorage;
21 | import org.seaborne.delta.server.local.patchstores.mem.PatchStorageMem;
22 |
23 | public class TestPatchStorageMem extends AbstractTestPatchStorage {
24 |
25 | @Override
26 | protected PatchStorage patchStorage() {
27 | return new PatchStorageMem();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/test/java/org/seaborne/delta/server/patchstores/TestPatchStoreFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.patchstores;
19 |
20 | import org.apache.jena.atlas.lib.FileOps;
21 | import org.junit.After;
22 | import org.seaborne.delta.server.Provider;
23 | import org.seaborne.delta.server.local.*;
24 | import org.seaborne.delta.server.local.patchstores.file.PatchStoreFile;
25 |
26 | public class TestPatchStoreFile extends AbstractTestPatchStore {
27 | private static String DIR = "target/test/patch-store-file";
28 |
29 | @After public void afterPatchStoreFile() {
30 | PatchStoreFile.resetTracked();
31 | }
32 |
33 | @Override
34 | protected PatchStore patchStore(DataSourceRegistry dataRegistry) {
35 | LocalServerConfig conf = LocalServers.configFile(DIR);
36 | PatchStore patchStore = PatchStoreMgr.getPatchStoreProvider(Provider.FILE).create(conf);
37 | FileOps.ensureDir(DIR);
38 | FileOps.clearAll(DIR);
39 | patchStore.initialize(dataRegistry, conf);
40 | return patchStore;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/test/java/org/seaborne/delta/server/patchstores/TestPatchStoreMem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.patchstores;
19 |
20 | import org.junit.Test ;
21 | import org.seaborne.delta.server.Provider;
22 | import org.seaborne.delta.server.local.*;
23 |
24 | public class TestPatchStoreMem extends AbstractTestPatchStore {
25 |
26 | @Override
27 | protected PatchStore patchStore(DataSourceRegistry dataRegistry) {
28 | LocalServerConfig config = LocalServers.configMem();
29 | PatchStore patchStore = PatchStoreMgr.getPatchStoreProvider(Provider.MEM).create(config);
30 | patchStore.initialize(dataRegistry, config);
31 | return patchStore;
32 | }
33 |
34 | // No persistent state - no recovery.
35 | @Override
36 | @Test public void recovery1() {}
37 | }
38 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/src/test/java/org/seaborne/delta/server/patchstores/TestPatchStoreZk.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 |
18 | package org.seaborne.delta.server.patchstores;
19 |
20 | import org.apache.curator.test.TestingServer;
21 | import org.junit.After;
22 | import org.junit.Before;
23 | import org.seaborne.delta.server.Provider;
24 | import org.seaborne.delta.server.ZkT;
25 | import org.seaborne.delta.server.local.*;
26 |
27 | public class TestPatchStoreZk extends AbstractTestPatchStore {
28 |
29 | @Before public void beforeZkTest() {}
30 | @After public void afterZkTest() { ZkT.clearAll(); }
31 |
32 | @Override
33 | protected PatchStore patchStore(DataSourceRegistry dataRegistry) {
34 | TestingServer server = ZkT.localServer();
35 | String connectionString = server.getConnectString();
36 | LocalServerConfig config = LocalServers.configZk(connectionString);
37 | PatchStore patchStore = PatchStoreMgr.getPatchStoreProvider(Provider.ZKZK).create(config);
38 | patchStore.initialize(dataRegistry, config);
39 | return patchStore;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/testing/DeltaServer/data1/data.ttl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/rdf-delta-server-local/testing/DeltaServer/data1/data.ttl
--------------------------------------------------------------------------------
/rdf-delta-server-local/testing/DeltaServer/data1/source.cfg:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "data1" ,
3 | "uri" : "http://example/data1" ,
4 | "id" : "15724832-96c5-11e6-9d7f-131fb3e5c030" ,
5 | "log_type": "file"
6 | }
7 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/testing/DeltaServer/data2/data.ttl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/rdf-delta-server-local/testing/DeltaServer/data2/data.ttl
--------------------------------------------------------------------------------
/rdf-delta-server-local/testing/DeltaServer/data2/source.cfg:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "data2" ,
3 | "uri" : "http://example/data2" ,
4 | "id" : "9810a10a-43d7-42c4-ad18-61d00e15ffa1" ,
5 | "log_type": "file"
6 | }
7 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/testing/DeltaServer/dataDisabled/disabled:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/rdf-delta-server-local/testing/DeltaServer/dataDisabled/disabled
--------------------------------------------------------------------------------
/rdf-delta-server-local/testing/DeltaServer/dataDisabled/source.cfg:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "dataDisabled" ,
3 | "uri" : "http://example/data1" ,
4 | "id" : "15724832-96c5-11e6-9d7f-131fb3e5c030" ,
5 | "log_type": "file"
6 | }
7 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/testing/DeltaServer/delta.cfg:
--------------------------------------------------------------------------------
1 | {
2 | "version" : 1 ,
3 | "port" : 5050 ,
4 | "log_type" : "local"
5 | }
6 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/testing/DeltaServerBlankDft/delta.cfg:
--------------------------------------------------------------------------------
1 | {
2 | "version" : 1 ,
3 | "port" : 5050
4 | }
5 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/testing/DeltaServerBlankFile/delta.cfg:
--------------------------------------------------------------------------------
1 | {
2 | "version" : 1 ,
3 | "port" : 5050 ,
4 | "log_type" : "file"
5 | }
6 |
--------------------------------------------------------------------------------
/rdf-delta-server-local/testing/delta.cfg:
--------------------------------------------------------------------------------
1 | {
2 | "version" : 1 ,
3 | "port" : 5050
4 | }
5 |
--------------------------------------------------------------------------------
/rdf-delta-server/src/main/java/Dummy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | *
14 | * See the NOTICE file distributed with this work for additional
15 | * information regarding copyright ownership.
16 | */
17 | /*
18 | * Licensed under the Apache License, Version 2.0 (the "License");
19 | * you may not use this file except in compliance with the License.
20 | * You may obtain a copy of the License at
21 | *
22 | * http://www.apache.org/licenses/LICENSE-2.0
23 | *
24 | * Unless required by applicable law or agreed to in writing, software
25 | * distributed under the License is distributed on an "AS IS" BASIS,
26 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27 | * See the License for the specific language governing permissions and
28 | * limitations under the License.
29 | *
30 | * See the NOTICE file distributed with this work for additional
31 | * information regarding copyright ownership.
32 | */
33 | /* Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 */
34 |
35 | public class Dummy {}
36 |
--------------------------------------------------------------------------------