├── .github ├── CONTRIBUTING.md ├── dependabot.yml └── workflows │ ├── maven.yml │ └── pr.yml ├── .gitignore ├── BUILD.md ├── LICENSE ├── NOTICE ├── README.md ├── docs ├── .gitignore ├── _config.yml ├── _includes │ ├── analytics.html │ ├── footer.html │ ├── header.html │ ├── nav.html │ └── top.html ├── _layouts │ ├── base.html │ ├── doc-no-nav.html │ ├── doc.html │ ├── full-page.html │ └── post.html ├── cmds.md ├── css │ ├── bootstrap-theme.min.css │ ├── bootstrap.css │ ├── bootstrap.min.css │ ├── custom.css │ ├── doc.css │ ├── plain.css │ ├── simple-sidebar.css │ └── simple-sidebar.css-original ├── delta-fuseki-config.md ├── delta-server-api.md ├── delta-server.md ├── delta.md ├── favicon.ico ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── ha-fuseki.md ├── ha-system.md ├── index.md ├── js │ ├── bootstrap.js │ ├── bootstrap.min.js │ └── jquery.js ├── rdf-patch-logs.md ├── rdf-patch.md ├── unfinished │ ├── delta-api.md │ └── delta-cmds.md └── use-cases.md ├── pom.xml ├── rdf-delta-base ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── seaborne │ │ │ └── delta │ │ │ ├── DataSourceDescription.java │ │ │ ├── Delta.java │ │ │ ├── DeltaBadPatchException.java │ │ │ ├── DeltaBadRequestException.java │ │ │ ├── DeltaConfigException.java │ │ │ ├── DeltaConst.java │ │ │ ├── DeltaException.java │ │ │ ├── DeltaFileException.java │ │ │ ├── DeltaHttpException.java │ │ │ ├── DeltaLib.java │ │ │ ├── DeltaNotFoundException.java │ │ │ ├── DeltaOps.java │ │ │ ├── DeltaPatchVersionException.java │ │ │ ├── Id.java │ │ │ ├── LockState.java │ │ │ ├── PatchLogInfo.java │ │ │ ├── PersistentCounter.java │ │ │ ├── PersistentState.java │ │ │ ├── RDF_Delta.java │ │ │ ├── RefLong.java │ │ │ ├── RefLongMem.java │ │ │ ├── RefString.java │ │ │ ├── RefStringMem.java │ │ │ ├── StateLongString.java │ │ │ ├── Version.java │ │ │ ├── lib │ │ │ ├── DSG.java │ │ │ ├── DatasetGraphStableGraphs.java │ │ │ ├── GraphListenerBase.java │ │ │ ├── JSONX.java │ │ │ ├── LibX.java │ │ │ ├── LogX.java │ │ │ └── OutputStream2.java │ │ │ ├── link │ │ │ ├── DeltaLink.java │ │ │ ├── DeltaLinkCounter.java │ │ │ ├── DeltaLinkEvents.java │ │ │ ├── DeltaLinkListener.java │ │ │ ├── DeltaLinkPatchEvents.java │ │ │ ├── DeltaLinkWrapper.java │ │ │ ├── DeltaLog.java │ │ │ ├── DeltaNotConnectedException.java │ │ │ ├── DeltaNotRegisteredException.java │ │ │ ├── LinkEvent.java │ │ │ └── RDFChangesGraphEvents.java │ │ │ └── sys │ │ │ └── InitDelta.java │ └── resources │ │ ├── META-INF │ │ ├── LICENSE │ │ ├── NOTICE │ │ └── services │ │ │ └── org.apache.jena.sys.JenaSubsystemLifecycle │ │ └── org │ │ └── seaborne │ │ └── delta │ │ └── delta-properties.xml │ └── test │ ├── java │ └── org │ │ └── seaborne │ │ └── delta │ │ ├── TS_DeltaBase.java │ │ ├── TestId.java │ │ ├── TestPersistentState.java │ │ └── TestVersion.java │ └── resources │ └── logging.properties ├── rdf-delta-client ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── seaborne │ │ └── delta │ │ └── client │ │ ├── DRPC.java │ │ ├── DataState.java │ │ ├── DeltaClient.java │ │ ├── DeltaClientLib.java │ │ ├── DeltaConnection.java │ │ ├── DeltaLinkHTTP.java │ │ ├── DeltaLinkSwitchable.java │ │ ├── FN.java │ │ ├── InitDeltaClient.java │ │ ├── LocalStorageType.java │ │ ├── LogLock.java │ │ ├── LogLockMgr.java │ │ ├── RDFChangesHTTP.java │ │ ├── SyncPolicy.java │ │ ├── Zone.java │ │ └── assembler │ │ ├── DatasetNoChangesAssembler.java │ │ ├── DeltaAssembler.java │ │ ├── LibBuildDC.java │ │ ├── ManagedDatasetBuilder.java │ │ └── VocabDelta.java │ └── resources │ └── META-INF │ ├── LICENSE │ ├── NOTICE │ └── services │ └── org.apache.jena.sys.JenaSubsystemLifecycle ├── rdf-delta-cmds ├── bin │ ├── dcmd │ ├── list │ ├── mksrc │ ├── patchserver │ ├── rdf2patch │ └── rmsrc ├── pom.xml ├── src │ ├── main │ │ └── java │ │ │ ├── dcmd.java │ │ │ ├── delta │ │ │ ├── dcmd.java │ │ │ └── server │ │ │ │ ├── DeltaServerCmd.java │ │ │ │ ├── DeltaServerConfig.java │ │ │ │ ├── ServerBuildLib.java │ │ │ │ └── ZkJVM.java │ │ │ └── org │ │ │ └── seaborne │ │ │ └── delta │ │ │ ├── cmds │ │ │ ├── CmdPatch.java │ │ │ ├── DCmds.java │ │ │ ├── DeltaCmd.java │ │ │ ├── DeltaCmdServerOp.java │ │ │ ├── DeltaCmd_2.java │ │ │ ├── DeltaLogging.java │ │ │ ├── append.java │ │ │ ├── catpatch.java │ │ │ ├── cplog.java │ │ │ ├── dcmd.java │ │ │ ├── getpatch.java │ │ │ ├── list.java │ │ │ ├── mklog.java │ │ │ ├── monitor.java │ │ │ ├── mvlog.java │ │ │ ├── patch2rdf.java │ │ │ ├── patch2update.java │ │ │ ├── patchparse.java │ │ │ ├── patchreif.java │ │ │ ├── pingserver.java │ │ │ ├── rdf2patch.java │ │ │ ├── resync.java │ │ │ └── rmlog.java │ │ │ └── tools │ │ │ └── load.java │ └── test │ │ ├── java │ │ └── org │ │ │ └── seaborne │ │ │ └── delta │ │ │ └── cmds │ │ │ ├── CmdTestLib.java │ │ │ ├── MockS3.java │ │ │ ├── TS_DeltaCmds.java │ │ │ ├── TestCmdServer.java │ │ │ ├── TestCmdServerZkS3.java │ │ │ ├── TestCmds.java │ │ │ ├── TestDeltaServerConfig.java │ │ │ └── TestLocalServerCmdSetup.java │ │ └── resources │ │ └── log4j2-test.properties └── testing │ ├── data.rdfp │ └── jetty.xml ├── rdf-delta-dist ├── Files │ ├── dcmd │ └── log4j2.xml ├── README ├── assembly-dist.xml ├── dist │ ├── LICENSE │ └── NOTICE ├── jetty.xml └── pom.xml ├── rdf-delta-examples ├── .gitignore ├── ExampleFusekiConfigs │ ├── fuseki_conf.ttl │ └── fuseki_conf_1.ttl ├── Tutorial │ ├── data.ttl │ ├── fuseki-config.ttl │ ├── log4j2.xml │ ├── patch.rdfp │ └── zk-example │ │ ├── clean │ │ ├── dzk-server │ │ ├── fuseki1 │ │ ├── config.ttl │ │ └── run-fuseki │ │ ├── fuseki2 │ │ ├── config.ttl │ │ └── run-fuseki │ │ ├── log4j.properties │ │ ├── log4j2.xml │ │ ├── single │ │ ├── log4j.properties │ │ ├── zk-run │ │ └── zoo.cfg │ │ ├── zk1 │ │ ├── ZkData │ │ │ └── myid │ │ ├── log4j2.xml │ │ ├── run-delta │ │ ├── run-zk │ │ ├── zoo.cfg │ │ └── zoo.dynamic │ │ ├── zk2 │ │ ├── ZkData │ │ │ └── myid │ │ ├── log4j2.xml │ │ ├── run-delta │ │ ├── run-zk │ │ ├── zoo.cfg │ │ └── zoo.dynamic │ │ └── zk3 │ │ ├── ZkData │ │ └── myid │ │ ├── log4j2.xml │ │ ├── run-delta │ │ ├── run-zk │ │ ├── zoo.cfg │ │ └── zoo.dynamic ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── seaborne │ │ │ └── delta │ │ │ └── examples │ │ │ ├── DeltaEx01_DatasetWithPatchLog.java │ │ │ ├── DeltaEx02_DatasetCollectPatch.java │ │ │ ├── DeltaEx03_FusekiLogChanges.java │ │ │ ├── DeltaEx04_DatasetToPatchLogServer.java │ │ │ ├── DeltaEx05_FusekiPatchOperation.java │ │ │ ├── DeltaEx06_LocalDatasetToFuseki.java │ │ │ ├── DeltaEx07_TwoDatasetsPatchLogServer.java │ │ │ ├── DeltaEx08_CreateDataSourceLocal.java │ │ │ ├── DeltaEx09_CreateDataSourceHTTP.java │ │ │ ├── DeltaEx10_PollingClient.java │ │ │ ├── DeltaEx_FusekiHighAvailability.java │ │ │ └── package-info.java │ │ └── resources │ │ ├── data.ttl │ │ └── log4j2.xml └── testing │ ├── delta.cfg │ ├── fuseki_conf_1.ttl │ ├── fuseki_conf_2.ttl │ └── test_dlink │ ├── patch-empty.rdfp │ ├── patch1.rdfp │ ├── patch2.rdfp │ ├── patch3.rdfp │ ├── patch_bad_1.rdfp │ ├── patch_bad_2.rdfp │ └── patch_bad_3.rdfp ├── rdf-delta-fuseki-server ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── seaborne │ └── delta │ └── fuseki │ └── cmd │ ├── DeltaBackupServer.java │ └── DeltaFusekiServerCmd.java ├── rdf-delta-fuseki ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── seaborne │ │ │ └── delta │ │ │ └── fuseki │ │ │ ├── DeltaFuseki.java │ │ │ ├── InitDeltaFuseki.java │ │ │ ├── PatchApplyService.java │ │ │ └── PatchWriteServlet.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org.apache.jena.sys.JenaSubsystemLifecycle │ └── test │ ├── java │ └── org │ │ └── seaborne │ │ └── delta │ │ └── fuseki │ │ ├── TS_DeltaFuseki.java │ │ └── TestPatchFuseki.java │ └── resources │ └── logging.properties ├── rdf-delta-integration-tests ├── .gitignore ├── fuseki-config.ttl ├── pom.xml ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── seaborne │ │ │ └── delta │ │ │ ├── load │ │ │ └── Driver.java │ │ │ └── systemtest │ │ │ ├── Matrix.java │ │ │ └── ZkM.java │ └── test │ │ ├── java │ │ └── org │ │ │ └── seaborne │ │ │ └── delta │ │ │ ├── AbstractTestDeltaClient.java │ │ │ ├── AbstractTestDeltaConnection.java │ │ │ ├── AbstractTestDeltaLink.java │ │ │ ├── AbstractTestDeltaLogLock.java │ │ │ ├── AbstractTestLogLock.java │ │ │ ├── BaseTestDeltaFuseki.java │ │ │ ├── DeltaTestLib.java │ │ │ ├── RDFChangesNotExpected.java │ │ │ ├── Setup.java │ │ │ ├── TC_DeltaIntegration.java │ │ │ ├── TS_Delta.java │ │ │ ├── TestDeltaAssembler.java │ │ │ ├── TestDeltaFuseki.java │ │ │ ├── TestDeltaFusekiBad.java │ │ │ ├── TestDeltaFusekiGood.java │ │ │ ├── TestDeltaLogLockFile.java │ │ │ ├── TestDeltaLogLockMem.java │ │ │ ├── TestDeltaLogLockZk.java │ │ │ ├── TestLocalClient.java │ │ │ ├── TestLocalConnectionFile.java │ │ │ ├── TestLocalConnectionMem.java │ │ │ ├── TestLocalConnectionRocksDB.java │ │ │ ├── TestLocalConnectionZk.java │ │ │ ├── TestLocalLinkFile.java │ │ │ ├── TestLocalLinkMem.java │ │ │ ├── TestLocalLinkRocksDB.java │ │ │ ├── TestLocalLinkZk.java │ │ │ ├── TestLogLockFile.java │ │ │ ├── TestLogLockMem.java │ │ │ ├── TestLogLockZk.java │ │ │ ├── TestManagedDatasetBuilder.java │ │ │ ├── TestManagedDatasetBuilder2.java │ │ │ ├── TestReleaseSetup.java │ │ │ ├── TestRemoteClient.java │ │ │ ├── TestRemoteConnection.java │ │ │ ├── TestRemoteLink.java │ │ │ ├── TestRestart.java │ │ │ ├── TestZone.java │ │ │ └── integration │ │ │ ├── PrintLib.java │ │ │ ├── TS_DeltaZk.java │ │ │ ├── TestDeltaZk.java │ │ │ ├── TestDeltaZkFuseki.java │ │ │ └── TestZkExtra.java │ │ └── resources │ │ └── logging.properties └── testing │ ├── assembler │ ├── delta-assembler-ext-bad-1.ttl │ ├── delta-assembler-ext-bad-2.ttl │ ├── delta-assembler-ext-bad-3.ttl │ ├── delta-assembler-ext-good-1.ttl │ ├── delta-assembler-ext-good-2.ttl │ ├── delta-dataset-mem.ttl │ ├── delta-dataset-tdb1.ttl │ └── delta-dataset-tdb2.ttl │ ├── data.rdfp │ ├── delta.cfg │ ├── fuseki │ ├── fuseki-assembler-ext.ttl │ ├── fuseki_conf_1.ttl │ └── fuseki_conf_2.ttl │ └── test_dlink │ ├── patch-empty.rdfp │ ├── patch-graph.rdfp │ ├── patch1.rdfp │ ├── patch2.rdfp │ ├── patch3.rdfp │ ├── patch_bad_1.rdfp │ ├── patch_bad_2.rdfp │ └── patch_bad_3.rdfp ├── rdf-delta-server-extra ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── seaborne │ │ │ └── delta │ │ │ └── server │ │ │ └── s3 │ │ │ ├── InitDeltaZkS3.java │ │ │ ├── InitZkS3.java │ │ │ ├── PatchStorageS3.java │ │ │ ├── PatchStoreProviderZkS3.java │ │ │ ├── PatchStoreZkS3.java │ │ │ ├── S3.java │ │ │ ├── S3Config.java │ │ │ └── S3Const.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org.seaborne.delta.server.system.DeltaSubsystemLifecycle │ └── test │ ├── java │ └── org │ │ └── seaborne │ │ └── delta │ │ └── server │ │ └── s3 │ │ ├── S3T.java │ │ ├── TS_ServerExtra.java │ │ ├── TestPatchLogZkS3.java │ │ ├── TestPatchStorageS3.java │ │ └── TestPatchStoreZkS3.java │ └── resources │ └── logging.properties ├── rdf-delta-server-http ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── seaborne │ │ │ └── delta │ │ │ └── server │ │ │ └── http │ │ │ ├── Args.java │ │ │ ├── DeltaAction.java │ │ │ ├── DeltaServer.java │ │ │ ├── DeltaServlet.java │ │ │ ├── F_PatchFilter.java │ │ │ ├── HttpErrorHandler.java │ │ │ ├── HttpOperationBase.java │ │ │ ├── LogOp.java │ │ │ ├── PatchLogServer.java │ │ │ ├── S_DRPC.java │ │ │ ├── S_FetchData.java │ │ │ ├── S_GetPostLog.java │ │ │ ├── S_Metrics.java │ │ │ ├── S_Ping.java │ │ │ ├── S_ReplyJSON.java │ │ │ ├── S_ReplyText.java │ │ │ ├── S_Restart.java │ │ │ ├── ServerLib.java │ │ │ └── ZkMode.java │ └── resources │ │ └── META-INF │ │ ├── LICENSE │ │ └── NOTICE │ └── test │ ├── java │ └── org │ │ └── seaborne │ │ └── delta │ │ └── server │ │ └── http │ │ ├── TS_ServerHTTP.java │ │ └── TestURLParsing.java │ └── resources │ └── logging.properties ├── rdf-delta-server-local ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── seaborne │ │ │ │ └── delta │ │ │ │ ├── server │ │ │ │ ├── Provider.java │ │ │ │ ├── local │ │ │ │ │ ├── DPS.java │ │ │ │ │ ├── DataSource.java │ │ │ │ │ ├── DataSourceRegistry.java │ │ │ │ │ ├── DeltaLinkLocal.java │ │ │ │ │ ├── InitDeltaServerLocalFirst.java │ │ │ │ │ ├── InitDeltaServerLocalLast.java │ │ │ │ │ ├── InitJenaDeltaServerLocal.java │ │ │ │ │ ├── JsonLogEntry.java │ │ │ │ │ ├── LocalServer.java │ │ │ │ │ ├── LocalServerConfig.java │ │ │ │ │ ├── LocalServers.java │ │ │ │ │ ├── LogEntry.java │ │ │ │ │ ├── Patch.java │ │ │ │ │ ├── PatchCache.java │ │ │ │ │ ├── PatchHandler.java │ │ │ │ │ ├── PatchLog.java │ │ │ │ │ ├── PatchStore.java │ │ │ │ │ ├── PatchStoreMgr.java │ │ │ │ │ ├── PatchStoreProvider.java │ │ │ │ │ ├── PatchValidation.java │ │ │ │ │ ├── handlers │ │ │ │ │ │ ├── PHandlerLocalDB.java │ │ │ │ │ │ ├── PHandlerLog.java │ │ │ │ │ │ ├── PHandlerOutput.java │ │ │ │ │ │ ├── PHandlerSPARQLUpdate.java │ │ │ │ │ │ └── PHandlerSPARQLUpdateOutput.java │ │ │ │ │ └── patchstores │ │ │ │ │ │ ├── FileNames.java │ │ │ │ │ │ ├── LogIndex.java │ │ │ │ │ │ ├── PatchLogBase.java │ │ │ │ │ │ ├── PatchLogIndex.java │ │ │ │ │ │ ├── PatchLogIndexBase.java │ │ │ │ │ │ ├── PatchStorage.java │ │ │ │ │ │ ├── any │ │ │ │ │ │ ├── AbstractPatchStoreLocal.java │ │ │ │ │ │ ├── LocalUtils.java │ │ │ │ │ │ ├── PatchStoreAnyLocal.java │ │ │ │ │ │ └── PatchStoreProviderAnyLocal.java │ │ │ │ │ │ ├── file │ │ │ │ │ │ ├── LogIndexFile.java │ │ │ │ │ │ ├── LogIndexFileBuilder.java │ │ │ │ │ │ ├── PatchLogIndexFile.java │ │ │ │ │ │ ├── PatchStorageFile.java │ │ │ │ │ │ ├── PatchStoreFile.java │ │ │ │ │ │ └── PatchStoreProviderFile.java │ │ │ │ │ │ ├── filestore │ │ │ │ │ │ ├── FS.java │ │ │ │ │ │ ├── FileArea.java │ │ │ │ │ │ ├── FileEntry.java │ │ │ │ │ │ └── FileStore.java │ │ │ │ │ │ ├── mem │ │ │ │ │ │ ├── LogIndexMem.java │ │ │ │ │ │ ├── PatchLogIndexMem.java │ │ │ │ │ │ ├── PatchStorageMem.java │ │ │ │ │ │ ├── PatchStoreMem.java │ │ │ │ │ │ └── PatchStoreProviderMem.java │ │ │ │ │ │ ├── rdb │ │ │ │ │ │ ├── LogIndexRocks.java │ │ │ │ │ │ ├── PatchLogIndexRocks.java │ │ │ │ │ │ ├── PatchStorageRocks.java │ │ │ │ │ │ ├── PatchStoreProviderRocks.java │ │ │ │ │ │ ├── PatchStoreRocks.java │ │ │ │ │ │ ├── RocksConst.java │ │ │ │ │ │ └── RocksDatabase.java │ │ │ │ │ │ └── zk │ │ │ │ │ │ ├── PatchLogIndexZk.java │ │ │ │ │ │ ├── PatchStorageZk.java │ │ │ │ │ │ ├── PatchStoreProviderZk.java │ │ │ │ │ │ ├── PatchStoreZk.java │ │ │ │ │ │ └── ZkConst.java │ │ │ │ └── system │ │ │ │ │ ├── DeltaInitLevel1.java │ │ │ │ │ ├── DeltaSubsystemLifecycle.java │ │ │ │ │ ├── DeltaSystem.java │ │ │ │ │ ├── Initializer.java │ │ │ │ │ ├── JenaInitHook.java │ │ │ │ │ ├── SubsystemLifecycle.java │ │ │ │ │ ├── SubsystemRegistry.java │ │ │ │ │ └── SubsystemRegistryBasic.java │ │ │ │ └── zk │ │ │ │ ├── Zk.java │ │ │ │ ├── ZkException.java │ │ │ │ ├── ZkS.java │ │ │ │ └── ZooServer.java │ │ └── resources │ │ │ └── META-INF │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── services │ │ │ ├── org.apache.jena.sys.JenaSubsystemLifecycle │ │ │ └── org.seaborne.delta.server.system.DeltaSubsystemLifecycle │ └── test │ │ ├── java │ │ └── org │ │ │ └── seaborne │ │ │ └── delta │ │ │ └── server │ │ │ ├── TS_ServerLocal.java │ │ │ ├── TestFileStore.java │ │ │ ├── TestLocalServer.java │ │ │ ├── TestLocalServerBuildConfig.java │ │ │ ├── TestLocalServerCreateDelete.java │ │ │ ├── ZkT.java │ │ │ └── patchstores │ │ │ ├── AbstractTestPatchLog.java │ │ │ ├── AbstractTestPatchLogIndex.java │ │ │ ├── AbstractTestPatchStorage.java │ │ │ ├── AbstractTestPatchStore.java │ │ │ ├── TestPatchLogFile.java │ │ │ ├── TestPatchLogFileRocks.java │ │ │ ├── TestPatchLogIndexMem.java │ │ │ ├── TestPatchLogMem.java │ │ │ ├── TestPatchLogZk.java │ │ │ ├── TestPatchStorageMem.java │ │ │ ├── TestPatchStorageRocks.java │ │ │ ├── TestPatchStorageZk.java │ │ │ ├── TestPatchStoreFile.java │ │ │ ├── TestPatchStoreMem.java │ │ │ ├── TestPatchStoreRocks.java │ │ │ └── TestPatchStoreZk.java │ │ └── resources │ │ └── logging.properties └── testing │ ├── DeltaServer │ ├── data1 │ │ ├── data.ttl │ │ └── source.cfg │ ├── data2 │ │ ├── data.ttl │ │ └── source.cfg │ ├── dataDisabled │ │ ├── disabled │ │ └── source.cfg │ └── delta.cfg │ ├── DeltaServerBlankDft │ └── delta.cfg │ ├── DeltaServerBlankFile │ └── delta.cfg │ └── delta.cfg └── rdf-delta-server ├── pom.xml └── src └── main └── java └── Dummy.java /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 2 | 3 | # Documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "maven" 9 | directory: "/" 10 | schedule: 11 | interval: "weekly" 12 | day: "thursday" 13 | open-pull-requests-limit: 5 14 | groups: 15 | maven-patch-group: 16 | update-types: 17 | - "patch" 18 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 2 | 3 | name: RDF Delta Project CI 4 | 5 | on: 6 | workflow_dispatch: 7 | push: 8 | branches: [ main ] 9 | 10 | jobs: 11 | build: 12 | 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | os: [ubuntu-latest] 17 | java_version: ['21'] 18 | 19 | runs-on: ${{ matrix.os }} 20 | 21 | steps: 22 | - uses: actions/checkout@v3 23 | - name: Set up JDK ${{ matrix.java_version }} 24 | uses: actions/setup-java@v4 25 | with: 26 | distribution: 'temurin' 27 | java-version: ${{ matrix.java_version }} 28 | - name: Build with Maven 29 | run: mvn -B --file pom.xml -Dmaven.javadoc.skip=true install 30 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | ## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 2 | 3 | name: Build on PR 4 | 5 | on: 6 | pull_request: 7 | types: 8 | - opened 9 | - reopened 10 | branches: 11 | - 'main' 12 | 13 | permissions: 14 | contents: read 15 | 16 | jobs: 17 | 18 | build-pr: 19 | ## Dependabot only 20 | ## if: github.actor == 'dependabot[bot]' 21 | 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | jdk_distribution: ['temurin'] 26 | os: [ubuntu-latest] 27 | java_version: ['21'] 28 | 29 | runs-on: ${{ matrix.os }} 30 | 31 | steps: 32 | 33 | - name: Checkout code 34 | uses: actions/checkout@v4 35 | 36 | - name: Set up JDK ${{ matrix.java_version }} 37 | uses: actions/setup-java@v4 38 | with: 39 | distribution: ${{ matrix.jdk_distribution }} 40 | java-version: ${{ matrix.java_version }} 41 | 42 | - name: Build with Maven (Java${{ matrix.java_version }} ${{ matrix.jdk_distribution }}) 43 | ## No javadoc - that needs visual check 44 | run: mvn -B --file pom.xml -Dmaven.javadoc.skip=true install 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Java ### 2 | *.class 3 | *.jar 4 | *.war 5 | hs_err_pid* 6 | 7 | delta.classpath* 8 | 9 | ## Local 10 | /local/ 11 | 12 | ### Maven ### 13 | target/ 14 | pom.xml.tag 15 | pom.xml.releaseBackup 16 | pom.xml.versionsBackup 17 | pom.xml.next 18 | release.properties 19 | dependency-reduced-pom.xml 20 | buildNumber.properties 21 | .mvn/timing.properties 22 | 23 | rdf-delta-examples/Tutorial/PatchStore 24 | rdf-delta-examples/Tutorial/zk 25 | 26 | ### Gradle ### 27 | .gradle 28 | /build/ 29 | # Ignore Gradle GUI config 30 | gradle-app.setting 31 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 32 | !gradle-wrapper.jar 33 | # Cache of project 34 | .gradletasknamecache 35 | 36 | ### Intellij Idea ### 37 | .idea 38 | *.iml 39 | 40 | ### Eclipse ### 41 | .classpath 42 | .project 43 | .settings 44 | .recommenders 45 | .metadata 46 | 47 | ### Backups ### 48 | *.bak 49 | *.backup 50 | *~ 51 | .#* 52 | \#* 53 | -------------------------------------------------------------------------------- /BUILD.md: -------------------------------------------------------------------------------- 1 | # Build and Release Processes 2 | 3 | ## Build 4 | 5 | ``` 6 | mvn clean install 7 | ``` 8 | 9 | ## Release 10 | 11 | Edit `release-setup` and commit to main. 12 | All files must be commited 13 | 14 | Setup: this sets environment variables: 15 | 16 | ``` 17 | source release-setup 18 | ``` 19 | 20 | Dry run: 21 | ``` 22 | mvn $MVN_ARGS release:clean release:prepare 23 | mvn $MVN_ARGS release:clean 24 | ``` 25 | 26 | Release: 27 | ``` 28 | mvn $MVN_ARGS release:prepare 29 | mvn $MVN_ARGS release:perform 30 | ``` 31 | If it goes wrong: 32 | ``` 33 | mvn $MVN_ARGS release:rollback 34 | mvn $MVN_ARGS release:clean 35 | ``` 36 | or 37 | ``` 38 | mvn $MVN_ARGS versions:set -DnewVersion=Old version 39 | find . -name \*.versionsBackup | xargs rm 40 | ``` 41 | Delete tags. 42 | 43 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | RDF Delta 2 | ========= 3 | 4 | Copyright 2013-2022 Andy Seaborne 5 | Copyright 2016-2018 TopQuadrant Inc. 6 | 7 | Portions of this software derive from Apache Jena. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RDF Delta 2 | 3 | RDF Delta provides a system for recording and publishing changes to RDF 4 | Datasets. It is built around idea of change logs: 5 | 6 | * _RDF Patch_ - a format for recording changes to an RDF Dataset 7 | * _RDF Patch Log_ - organise patches in to a log of changes 8 | to an RDF Dataset with HTTP access. 9 | 10 | RDF Patch Logs can be used for: 11 | 12 | * Replicated datasets - 2 or more copies of a single dataset for high 13 | availability of the data. 14 | * Incremental backup of a dataset. 15 | * Recording changes 16 | * Generate alerts based on changes, either to the dataset as a whole or 17 | specific resources within the dataset. 18 | 19 | RDF Delta provides a system for keeping copies of an RDF Dataset 20 | up-to-date using the RDF Patch Log as a journal of changes to be applied. 21 | 22 | ## Documentation 23 | 24 | Website: https://afs.github.io/rdf-delta 25 | 26 | ## High Availablity Apache Jena Fuseki 27 | 28 | https://afs.github.io/rdf-delta/ha-fuseki.html 29 | 30 | ## Software 31 | 32 | Artifacts: https://repo1.maven.org/maven2/org/seaborne/rdf-delta 33 | 34 | RDF Delta distribution (patch log server and Apache Jena Fuseki with 35 | replicated dataset support) 36 | 37 | https://repo1.maven.org/maven2/org/seaborne/rdf-delta/rdf-delta-dist 38 | 39 | ### RDF Patch: 40 | 41 | ``` 42 | 43 | org.seaborne.rdf-delta 44 | rdf-patch 45 | X.Y.Z 46 | 47 | ``` 48 | 49 | ### RDF Delta client library: 50 | ``` 51 | 52 | org.seaborne.rdf-delta 53 | rdf-delta-client 54 | X.Y.Z 55 | 56 | ``` 57 | 58 | ## Contributing 59 | 60 | See [CONTRIBUTING](.github/CONTRIBUTING.md). 61 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | AFS 2 | _site 3 | .jekyll-cache/ 4 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | #repository: https://github.com/afs/rdf-delta/docs 2 | baseurl: /rdf-delta 3 | port: 4000 4 | encoding: utf-8 5 | exclude: [AFS,Gemfile, Gemfile.lock] 6 | #markdown: kramdown 7 | -------------------------------------------------------------------------------- /docs/_includes/analytics.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/docs/_includes/analytics.html -------------------------------------------------------------------------------- /docs/_includes/footer.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/docs/_includes/footer.html -------------------------------------------------------------------------------- /docs/_includes/header.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/docs/_includes/header.html -------------------------------------------------------------------------------- /docs/_includes/nav.html: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /docs/_includes/top.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ page.title }} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/_layouts/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% include top.html %} 5 | 6 | 7 | {% include header.html %} 8 | 9 | {{ content }} 10 | 11 | {% include footer.html %} 12 | 13 | {% include analytics.html %} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/_layouts/doc-no-nav.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | --- 4 | 5 |
6 | 7 |
8 | 9 | 12 | 13 |
14 |
15 | 16 |
17 | 18 | {{ content }} 19 | 20 |
21 | 22 |
23 | 24 |
25 |
26 |
27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/_layouts/doc.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | --- 4 | 5 |
6 | 7 | {% include nav.html %} 8 | 9 |
10 | 11 | 14 | 15 |
16 |
17 | 18 |
19 | 20 | {{ content }} 21 | 22 |
23 | 24 |
25 |
26 |
27 |
28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /docs/_layouts/full-page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | --- 4 | 5 |
6 | 7 | 10 | 11 |
12 |
13 | 14 |
15 | 16 | {{ content }} 17 | 18 |
19 | 20 |
21 | 22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 | 7 | 10 | 11 |
12 |
13 | 14 |
15 | 16 | {{ content }} 17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 |
25 | -------------------------------------------------------------------------------- /docs/css/custom.css: -------------------------------------------------------------------------------- 1 | /* Fonts loaded in top.html 2 | //fonts.googleapis.com/css?family=Open+Sans:300,400,600,300italic,400italic 3 | //fonts.googleapis.com/css?family=Roboto:300,500,300italic,500italic 4 | */ 5 | 6 | body { font-family: "Muli", "Open Sans", sans-serif ; 7 | font-size: 15px ; 8 | font-weight: 400 ; 9 | line-height: 25px; 10 | color: #404040 ; 11 | } 12 | 13 | /* 14 | body { font-family: "Roboto", sans-serif ; 15 | font-size: 15px ; 16 | font-weight: 300 ; 17 | line-height: 25px; 18 | color: #404040 ; 19 | } 20 | */ 21 | 22 | a { color : #0000C0 ; } 23 | a:hover { text-decoration: underline ; } 24 | a:visited { color : #000080 ; } 25 | 26 | h1 { font-size: 32px ; font-weight: bold ; } 27 | h2 { font-size: 24px ; font-weight: bold ; } 28 | h3 { font-size: 18px ; font-weight: bold ; } 29 | 30 | code { font-family: "Inconsolata" ; color: black ; background-color: #F0F0F0 ; } 31 | pre { font-family: "Inconsolata" ; } 32 | 33 | pre code { white-space: pre; overflow: auto;} 34 | 35 | blockquote { font-size: 14px ; color: #888 ; font-style: italic ; } 36 | 37 | table tr td,th { 38 | vertical-align: top; 39 | border-right: 1px dotted #A0A0A0; 40 | border-top: 1px dotted #A0A0A0; 41 | padding-left: 2em ; 42 | padding-right: 2em ; 43 | padding: 0.3em; 44 | } 45 | 46 | table { 47 | border: 1px solid #A0A0A0 ; 48 | border-spacing: 0; 49 | } 50 | 51 | table th { 52 | padding-left: 0.5em ; 53 | padding-right: 0.5em ; 54 | background-color: #ededee; 55 | } 56 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/docs/favicon.ico -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/docs/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/docs/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/docs/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afs/rdf-delta/889174b23f7a0a1d63185ee5688d6a3c835db278/docs/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: RDF Delta - Replicating RDF Datasets 4 | --- 5 | 6 | RDF Delta is a system for recording and publishing changes to RDF 7 | Datasets. 8 | 9 | It is built on top of the idea of change logs: 10 | 11 | * _RDF Patch_ - a format for recording changes to an RDF Dataset 12 | * _RDF Patch Log_ - organise patches in to a log of changes 13 | to an RDF Dataset with HTTP access. 14 | 15 | These can be useful in their own right. 16 | 17 | RDF Patch Logs can be used for: 18 | 19 | * Synchronized copies of a dataset - 2 or more copies of a single dataset for high 20 | availability of the data. 21 | * Incremental backup of a dataset. 22 | * Recording changes 23 | * Generate alerts based on changes, either to the dataset as a whole or 24 | specific resources within the dataset. 25 | 26 | Delta provides a server for RDF Patch Logs to support replicated 27 | datasets. 28 | 29 | See "[Delta](delta.html)" for a overview of the Delta system for 30 | distributing changes to RDF datasets. 31 | 32 | ## Documentation 33 | 34 | * "[Delta](delta.html)" for a overview of the Delta system 35 | * "[RDF Patch](rdf-patch.html)" for the format for recording changes. 36 | * "[RDF Patch Logs](rdf-patch-logs.html)" for organising and accessing RDF Patches 37 | 38 | ## System Examples 39 | 40 | * [High Available Fuseki](ha-system.html) 41 | 42 | ## Code 43 | 44 | [https://github.com/afs/rdf-delta](https://github.com/afs/rdf-delta) 45 | -------------------------------------------------------------------------------- /docs/unfinished/delta-api.md: -------------------------------------------------------------------------------- 1 | # API 2 | 3 | The API is a direct reflection of the protocol. 4 | 5 | ## Overview 6 | 7 | ## Servers, Links and Connections 8 | 9 | A DeltaLink is per-client channel to a server. Normally, there is one 10 | link in each client application to a server. 11 | 12 | A DetaConnection is a per-client, per-dataset. 13 | 14 | 15 | ## Example Code 16 | 17 | ## Control 18 | 19 | ## Patches -------------------------------------------------------------------------------- /docs/unfinished/delta-cmds.md: -------------------------------------------------------------------------------- 1 | # Command Line Tools 2 | 3 | (try "--help" for instructions) 4 | 5 | ## Server 6 | 7 | | Command | Purpose | 8 | | patchserver | An RDF delta patch log server | 9 | | mksrc | Create a data source (patch log and initial data) | 10 | | rmsrc | Remove (make inaccessible) a data source | 11 | | rdf2patch | Write out a patch file that adds the data of an RDF file | 12 | | list | List datsources | 13 | 14 | ## Running the server 15 | 16 | `bin/patchserver` 17 | 18 | or 19 | 20 | `java -jar rdf-delta-server.jar` 21 | 22 | ## Running Command Line Admin Tools 23 | 24 | The can be run with: 25 | 26 | `bin/` 27 | 28 | or 29 | 30 | `java -cp rdf-delta-server.jar org.seaborne.delta.cmds.` 31 | grep -------------------------------------------------------------------------------- /rdf-delta-base/src/main/java/org/seaborne/delta/DeltaBadPatchException.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 | /** Exception to throw when a bad patch is found */ 21 | public class DeltaBadPatchException extends DeltaBadRequestException { 22 | public DeltaBadPatchException(String msg) { super(msg) ; } 23 | 24 | // @Override 25 | // public Throwable fillInStackTrace() { 26 | // return this ; 27 | // } 28 | } 29 | -------------------------------------------------------------------------------- /rdf-delta-base/src/main/java/org/seaborne/delta/DeltaBadRequestException.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 | /** Exception to throw when a request is wrong in some way : 400 */ 21 | public class DeltaBadRequestException extends DeltaHttpException { 22 | public DeltaBadRequestException(String msg) 23 | { super(400, msg) ; } 24 | } 25 | -------------------------------------------------------------------------------- /rdf-delta-base/src/main/java/org/seaborne/delta/DeltaConfigException.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 DeltaConfigException extends DeltaException 21 | { 22 | public DeltaConfigException() { super() ; } 23 | public DeltaConfigException(String msg) { super(msg) ; } 24 | public DeltaConfigException(Throwable th) { super(th) ; } 25 | public DeltaConfigException(String msg, Throwable th) { super(msg, th) ; } 26 | } 27 | -------------------------------------------------------------------------------- /rdf-delta-base/src/main/java/org/seaborne/delta/DeltaException.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 DeltaException extends RuntimeException 21 | { 22 | public DeltaException() { super() ; } 23 | public DeltaException(String msg) { super(msg) ; } 24 | public DeltaException(Throwable th) { super(th) ; } 25 | public DeltaException(String msg, Throwable th) { super(msg, th) ; } 26 | } 27 | -------------------------------------------------------------------------------- /rdf-delta-base/src/main/java/org/seaborne/delta/DeltaFileException.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 DeltaFileException extends DeltaException 21 | { 22 | public DeltaFileException() { super() ; } 23 | public DeltaFileException(String msg) { super(msg) ; } 24 | public DeltaFileException(Throwable th) { super(th) ; } 25 | public DeltaFileException(String msg, Throwable th) { super(msg, th) ; } 26 | } 27 | -------------------------------------------------------------------------------- /rdf-delta-base/src/main/java/org/seaborne/delta/DeltaLib.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.json.JsonObject; 21 | import org.apache.jena.atlas.lib.DateTimeUtils; 22 | import org.seaborne.delta.lib.JSONX; 23 | 24 | public class DeltaLib { 25 | 26 | /** Generate a JsonObject that is the esponse to a "ping". 27 | * The object includes a timestamp. 28 | *
29 |      *  { "value" : timestamp }
30 |      *  
31 | */ 32 | public static JsonObject ping() { 33 | String now = DateTimeUtils.nowAsXSDDateTimeString(); 34 | JsonObject r = JSONX.buildObject(b->{ 35 | b.pair(DeltaConst.F_VALUE, now); 36 | }); 37 | return r ; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /rdf-delta-base/src/main/java/org/seaborne/delta/DeltaNotFoundException.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.web.HttpSC; 21 | 22 | public class DeltaNotFoundException extends DeltaHttpException 23 | { 24 | public DeltaNotFoundException(String msg) { super(HttpSC.NOT_FOUND_404, msg) ; } 25 | } 26 | -------------------------------------------------------------------------------- /rdf-delta-base/src/main/java/org/seaborne/delta/DeltaPatchVersionException.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.json.JsonObject; 21 | 22 | /** Exception to throw when a bad patch is found */ 23 | public class DeltaPatchVersionException extends DeltaBadRequestException { 24 | private final JsonObject body; 25 | 26 | public DeltaPatchVersionException(String responseMessage, JsonObject object) { 27 | super(responseMessage); 28 | this.body = object; 29 | } 30 | 31 | public JsonObject getBody() { 32 | return body; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /rdf-delta-base/src/main/java/org/seaborne/delta/RDF_Delta.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.seaborne.delta; 20 | 21 | import org.apache.jena.atlas.lib.Version; 22 | import org.apache.jena.query.ARQ; 23 | 24 | public class RDF_Delta { 25 | /** The product name */ 26 | public static final String NAME = "RDF Delta"; 27 | public static final String VERSION = Version.versionForClass(ARQ.class).orElse(""); 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 | --------------------------------------------------------------------------------