Maven dependency list for stardog examples - stardog

Could someone please post the maven dependencies needed to run the stardog 2.1.3 client examples? These critical ones keep coming up undefined
import com.complexible.common.openrdf.OpenRdfIO;
import com.complexible.common.protocols.server.Server;
import com.complexible.stardog.Stardog;

Server and Stardog are in the ${STARDOG}\server directory of the distribution; these are not installed by the maven install script because they're server dependencies and normally not needed in a client application. The complete end-to-end examples, because they include both client & server code, require both sets of dependencies.
The OpenRdfIO class no longer exists, you are using out of data code. If you use the version of the example in the distribution, it will have the correct class name.

Related

How do I set up a new ejabberd server?

I'm trying to figure out how to properly setup an ejabberd project that allows for easy compilation of custom beam files- so far, we've been using an existing project that is cumbersome to manage, and uses erlide as the IDE.
I would like to set up the project in a way that I can use a more helpful IDE like vscode, and somehow streamline the compiling and copying of the beam files and updating the module on the server.
Writing code in Elixir is fine as well- I just want the project to be set up in a way that is dev friendly.
Apologies if the question is too broad, but I'm not exactly sure how else to best phrase it. If you feel like I'm missing something in my current flow, please let me know, as I've basically inherited this project. If there are any clarifications required, let me know as well.
Thanks.
easy compilation of custom beam files
somehow streamline the compiling and copying of the beam files and updating the module on the server.
If the task is about compiling and loading additional modules, a running ejabberd node can compile, load and start additional modules in runtime, see
https://docs.ejabberd.im/developer/extending-ejabberd/modules/#ejabberd-contrib
Usually the modules come from
https://github.com/processone/ejabberd-contrib
but you can tell ejabberd to download other modules from other git repositories, or you can copy modules source code and tell ejabberd to install them. And those modules can be written in Erlang or Elixir. Full example: https://docs.ejabberd.im/developer/extending-ejabberd/elixir/#elixir-module-in-ejabberd-contrib
Basically:
you write the module in your development machine, test it...
when happy with the source code, copy mod_whatever.erl to the production machine, $HOME/.ejabberd-modules/sources/mod_whatever as explained in the example mentioned earlier
run ejabberdctl module_install mod_whatever
In step 2, instead of copying the source code yourself, you can have a git repository just for your module, tell ejabberd the module's git URL, similarly to https://github.com/processone/ejabberd-contrib/tree/master/extra
BTW, for step 3, starting in ejabberd 22.10, there's a page in ejabberd webadmin to install and uninstall those modules (copying the files requires manual administration of course).
I would like to set up the project in a way that I can use a more helpful IDE like vscode
What a coincidence, these days I'm playing with VSCode variants (VSCode, VSCodium, Coder's code-server and Github Codespaces) and how to develop ejabberd using them. This is useful for step 1 that I mentioned earlier (write module and test it). If you are interested in ejabberd + VSCode, tell me.

GraalVM native image reflection doesn't work

I'm trying to create a GraalVM native image using the maven plugin but having some issues.
Here the config for the maven plugin
I'm using GraalVM JDK (installed through Sdkman):
$ java -version
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment GraalVM CE 21.1.0 (build 16.0.1+9-jvmci-21.1-b05)
OpenJDK 64-Bit Server VM GraalVM CE 21.1.0 (build 16.0.1+9-jvmci-21.1-b05, mixed mode, sharing)
I have a done simple main class like:
package it.r;
public class Main {
public static void main(String[] args) {
System.out.println("********");
System.out.println(Main.class.getConstructors().length);
System.out.println("********");
}
}
When executing it using mvn exec:java -Dexec.mainClass=it.r.Main I get as a result:
********
1
********
But when doing mvn package and then executing the created executable, I have as result:
********
0
********
Why is this happening?
Here the git repo to reproduce
This issue seems to impact Jackson deserialization, as in another example I have an error from jackson that cannot deserialize a yaml file because it can't find constructors for my class.
When GraalVM native image builds your application into a native binary it statically analyzes your application.
The analysis is static, so several dynamic features your application might use require explicit configuration, for example:
reflection
serialization
method handles
using resources (like classloader.getResource())
JNI
This explicit configuration is provided as json configuration files, for example,
You can provide the config files manually, but you can also run your application using a javaagent which will record usages of features requiring configuration.
In a nutshell, you run your application like this:
java -agentlib:native-image-agent=config-output-dir=/path/to/config-dir/
and exercise the code paths that use the code you want to be configured. This is important because the tracing agent can only record the config for the code it actually saw running.
Then the output directory will contain a json file, for example looking like this:
[
{
"name":"StringCapitalizer",
"methods":[{"name":"capitalize","parameterTypes":["java.lang.String"] }]
},
{
"name":"StringReverser",
"methods":[{"name":"reverse","parameterTypes":["java.lang.String"] }]
}
This file lists the classes that need to be included into the analysis and the binary result and their members that need to be accessed.
It’s fairly straightforward but a bit tedious to create manually that’s why the agent approach is preferred.
There’s also a programmatic way to configure classes and members be registered for reflection, but using it means you need to include a dependency on the GraalVM code into your app.
Classes using reflections need to be registered in order to include them in the native image built, more info in the docs

How to acquire apache-beam .tar.gz file?

Apache-beam has been frustrating to manage with the correct google-cloud libraries for me to use with Dataflow.
I discovered for what I'm doing I need apache-beam=2.3.0 rather than 2.4.0 (2.4.0 gives a pickling error that I cannot resolve refer to Dataflow Error: 'Clients have non-trivial state that is local and unpickleable')
I need DataflowRunner to use apache-beam=2.3.0 as well so following this persons instructions Custom Apache Beam Python version in Dataflow I just need the actual tar.gz file I thought I had installed it via pip with a pip install apache-beam=2.3.0 so if I look in my system I can't find any tar.gz. When I go to the apache website to download the source code the link is broken.
Where can I find a tar.gz for apache-beam-2.3.0?
The latest and all history releases of apache-beam packages can be found on github - github.com/apache/beam/releases.

Magnolia EE license auto deploy

I am trying to build an automatic deploy system for Magnolia 5.4 EE. For this, I exported the license config node /config/modules/enterprise/license to a file config.modules.enterprise.license.xml and attached this to the mgnl-bootstrap/my-module-directory of my module.
In this bootstrap-directory, other xml configuration files are present and are entered as expected into the configuration database. However, after deploy Magnolia still asks me to enter the license key - everything else works fine, my product is deployed, etc.
I tried to find information in the Magnolia documentation, but to no avail. Anyone here who was able to automatically deploy a Magnolia EE?
It should work if you add a dependency to enterprise magnolia module in your my-module descriptor file. This way the enterprise module will be installed before your module, and you just add a new node to its config.
Another option is to add the license import file to WEB-INF/bootstrap/common, the difference here is that everything in that folder gets bootstrapped after all modules are started.

Unable to install gremlin-neo4j through gremlin shell

So, I'm going through the tutorial on getting started with the TinkerPop 3.0 stuff. I've gotten the basic API working with the TinkerGraph stuff, and I'm moving on to try and interface with my local Neo4j instance (Community 2.2.2). I'm working through the tutorial here:
http://tinkerpop.incubator.apache.org/docs/3.0.0.M9-incubating/
but, the neo4j-gremlin plugin does not appear to exist as documented. Neither the gradle line:
compile group : 'org.apache.tinkerpop', name: 'neo4j-gremlin', version: '3.0.0.M9-incubating'
, nor the following attempt through the gremlin groovy shell:
gremlin> :plugin list
==>tinkerpop.server[active]
==>tinkerpop.gephi
==>tinkerpop.utilities[active]
==>tinkerpop.sugar
==>tinkerpop.tinkergraph[active]
gremlin> :install org.apache.tinkerpop neo4j-gremlin 3.0.0.M9-incubating
Error grabbing Grapes -- [unresolved dependency: org.apache.tinkerpop#neo4j-gremlin;3.0.0.M9-incubating: not found]
Display stack trace? [yN] y
java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: org.apache.tinkerpop#neo4j-gremlin;3.0.0.M9-incubating: not found]
seem to work, because neither one can resolve the dependency. The problem persists if the M9 is replaced back to at least M7, or if I try and grab from 3.0.0-SNAPSHOT. Has TinkerPop just dropped support for Neo4j and has not updated their tutorials?
I guess there's some discrepancy between documentation and where Neo4j stands in terms of official release. Neo4j was removed from the repository around M7 at the time TinkerPop started making releases under the Apache Software Foundation (given license conflicts). It was added back to the repository after the M9 release as license issues were resolved. As it stands now, there is approval from Apache on the packaging of Neo4j thus allowing it to be officially included as part of the next release which should be GA.
Note that Neo4j has not changed its licensing structure for this to happen. It remains GPL-based. The GPL'd dependencies however are NOT packaged with TinkerPop binary distributions and the source distributions are free of GPL dependencies as well. It's an interesting model actually and took a fair bit of collaboration with all parties to accomplish.
It is actually pretty easy to work around this issue, but it involves you building TinkerPop from source. The following commands should do it:
git clone https://github.com/apache/incubator-tinkerpop.git
cd incubator-tinkerpop
git checkout tags/3.0.0-incubating-rc1
mvn clean install -DskipTests -DincludeNeo4j
Note that 3.0.0-incubating-rc1 is the current release candidate for GA that vendors are testing their implementations against right now. I assume that you've configured your grapeConfig.xml file as described in the TinkerPop 3 documentation, which would mean that it is configured to look at your local Maven .m2 directory. If so, that should get your :install command to work as well as other dependency management tools.

Resources