custom sparql filter Graphdb - graphdb

One of the things I would like to do is, implement my own SPARQL filter in GraphDB. GraphDB works with RDF4J so I was wondering whether such construction: http://docs.rdf4j.org/custom-sparql-functions/#_implementing_the_custom_function_as_a_java_class would be possible within GraphDB? I was looking around, but I cannot find where such JAR should be placed within GraphDB if possible?
First question is, is it possible to implement a own SPARQL Filter?

Is this resolved?
The only other thing I see is the error is reported as 'example.org/custom-function/palindrome': shouldn't this have http:// at the front?

Related

Can SHACL be implemented using SPARQL?

I'm trying to find a way to implement SHACL validations using SPARQL in my AWS Neptune Graph database. Is there a way to do so?
Well, it depends on what you mean by "implement". ;-)
You cannot implement all of SHACL with SPARQL alone, but you could implement some subset; not with a single query, though. You could, for example, write a query that collects the constraints of your shapes, and then use those results to generate a query that gets the relevant parts of your data; you could then examine those results and produce a validation report. And if you are doing stuff programmatically, you could of course implement also those parts with cannot be expressed through SPARQL (e.g., literal string patterns).
All that is somewhat "academic". There are open source SHACL implementations that you could use as a Neptune client (e.g., pySHACL if you are using Python and RDFLib). That would be a better and certainly a far more practical way.

How to retrieve bioportal mappings using SPARQL

Is there a way to query the bioportal mappings?
Say I have <http://purl.bioontology.org/ontology/UATC/V10BX02> in my graph, and I would like to pull additional information from MeSH. I'm not having much luck with the API, which is likely user error.
I found this website which has examples on how to query mappings between ontologies.
http://sparql.bioontology.org/examples

Generating SPARQL Query from SHACL

I have a specific situation where I need to automatically generate SPARQL queries based on the SHACL schemas of the incoming data. I wonder if Jena or any other semantic tool/library can help do that?
I saw something on the Jena code based but nothing official from the documentation.
Before I start trying to develop my own solution, I wonder if there is already some existing libraries on that or else initiative going on.

Mount a SPARQL endpoint for use with custom ontologies and triple RDFs

I've been trying to figure out how to mount a SPARQL endpoint for a couple of days, but as much as I read I can not understand it.
Comment my intention: I have an open data server mounted on CKAN and my goal is to be able to use SPARQL queries on the data. I know I could not do it directly on the datasets themselves, and I would have to define my own OWL and convert the data I want to use from CSV format (which is the format they are currently in) to RDF triple format (to be used as linked data).
The idea was to first test with the metadata of the repositories that can be generated automatically with the extension ckanext-dcat, but is that I really do not find where to start. I've searched for information on how to install a Virtuoso server for the SPARQL, but the information I've found leaves a lot to be desired, not to say that I can find nowhere to explain how I could actually introduce my own OWLs and RDFs into Virtuoso itself.
Someone who can lend me a hand to know how to start? Thank you
I'm a little confused. Maybe this is two or more questions?
1. How to convert tabular data, like CSV, into the RDF semantic format?
This can be done with an R2RML approach. Karma is a great GUI for that purpose. Like you say, a conversion like that can really be improved with an underlying OWL ontology. But it can be done without creating a custom ontology, too.
I have elaborated on this in the answer to another question.
2. Now that I have some RDF formatted data, how can I expose it with a SPARQL endpoint?
Virtuoso is a reasonable choice. There are multiple ways to deploy it and multiple ways to load the data, and therefore LOTs of tutorial on the subject. Here's one good one, from DBpedia.
If you'd like a simpler path to starting an RDF triplestore with a SPARQL endpoint, Stardog and Blazegraph are available as JARs, and RDF4J can easily be deployed within a container like Tomcat.
All provide web-based graphical interfaces for loading data and running queries, in addition to SPARQL REST endpoints. At least Stardog also provides command-line tools for bulk loading.

Manipulating RDF in Jena

currently, I found out that I can query using model (Model) syntax in Jena in a rdf after loading the model from a file, it gives me same output if I apply a sparql query. So, I want to know that , is it a good way to that without sparql? Though I have tested it with a small rdf file. I also want to know if I use Virtuoso can i manipulate using model syntax without sparql?
Thanks in Advance.
I'm not quite sure if I understand your question. If I can paraphrase, I think you're asking:
Is it OK to query and manipulate RDF data using the Jena Model API instead of using
SPARQL? Does it make a difference if the back-end store is Virtuoso?
Assuming that's the right re-phrasing of the question, then the first part is definitively yes: you can manipulate RDF data through the Model and OntModel APIs. In fact, I would say that's what the majority of Jena users do, particularly for small queries or updates. I find personally that going direct to the API is more succinct up to a certain point of complexity; after that, my code is clearer and more concise if I express the query in SPARQL. Obviously circumstances will have an effect: if you're working with a mixture of local stores and remote SPARQL endpoints (for which sending a query string is your only option) then you may find the consistency of always using SPARQL makes your code clearer.
Regarding Virtuoso, I don't have any direct experience to offer. As far as I know, the Virtuoso Jena Provider fully implements the features of the Model API using a Virtuoso store as the storage layer. Whether the direct API or using SPARQL queries gives you a performance advantage is something you should measure by benchmark with your data and your typical query patterns.