Re: mesh ontology queries

2024-05-09 Thread Luis Enrique Ramos García
Hi Arne,

thanks so much, I checked I had created the dataset into the default graph.

As soon as I created the named graph, as you recommended I got the expected
results.

Best regards


Luis

El mié, 8 may 2024 a las 23:30, Arne Bernhardt ()
escribió:

> Hi Louis,
>
> You might have uploaded the MeSH ontology into the default graph or at
> least not into a graph with the name `<http://id.nlm.nih.gov/mesh>`.
>
> From the query editor at https://id.nlm.nih.gov/mesh/query, I see that
> they
> have different graphs for each year (current = `<
> http://id.nlm.nih.gov/mesh>`,
> 2024 = `<http://id.nlm.nih.gov/mesh/2024>`, and 2023 = `<
> http://id.nlm.nih.gov/mesh/2023>`). To use the sample queries, you need to
> upload the data into the dataset using the corresponding names.
>
> Fixing the query is not an option if different years have all been uploaded
> into the same default graph. A glimpse into the data told me that all
> subjects begin with `http://id.nlm.nih.gov/mesh/`
> <http://id.nlm.nih.gov/mesh/>. So, you could filter for
> a specific year like this: `FILTER(STRSTARTS(STR(?subject), "
> http://id.nlm.nih.gov/mesh/2024";))`. Unfortunately, this does not work for
> the current year, as in your example, since
> `FILTER(STRSTARTS(STR(?subject), "http://id.nlm.nih.gov/mesh/";))` would
> include all subsequent years.
>
> To check your assumption about the default graph and where your data is: In
> the Fuseki UI, there is the "info" tab for your dataset, where you may
> click "count triples in all graphs," which gives you a list of all graphs
> in your dataset, their names, and the corresponding triple count. The
> following query should provide the same information:
>
> ```
> SELECT ?graph_name (COUNT(?s) AS ?triples)
> WHERE {
>   {
> BIND('default graph' AS ?graph_name)
> OPTIONAL { ?s ?p ?o. }
>   }
>   UNION
>   {
> GRAPH ?graph_name { OPTIONAL { ?s ?p ?o. } }
>   }
> }
> GROUP BY ?graph_name
> ```
>
> See also
>
> https://jena.apache.org/tutorials/sparql_datasets.html#describing-rdf-datasets---from-and-from-named
> .
>
> I hope this helps.
>
> Arne
>
> Am Mi., 8. Mai 2024 um 19:23 Uhr schrieb Luis Enrique Ramos García
> :
>
> > I uploaded the mesh ontology in fuseki,
> > but when I try with the query the sample queries recommended in their
> > documentation:
> > https://hhs.github.io/meshrdf/sample-queries
> >
> > I get no results.
> >
> > For instance:
> > PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> > PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
> > PREFIX owl: <http://www.w3.org/2002/07/owl#>
> > PREFIX meshv: <http://id.nlm.nih.gov/mesh/vocab#>
> > PREFIX mesh: <http://id.nlm.nih.gov/mesh/>
> > PREFIX mesh2015: <http://id.nlm.nih.gov/mesh/2015/>
> > PREFIX mesh2016: <http://id.nlm.nih.gov/mesh/2016/>
> > PREFIX mesh2017: <http://id.nlm.nih.gov/mesh/2017/>
> > SELECT DISTINCT ?p
> > FROM <http://id.nlm.nih.gov/mesh>
> > WHERE {
> > ?s ?p ?o
> > }
> > ORDER BY ?p
> >
> > It gives me no results, but when I comment out the line with the FROM
> > clause, I get some results.
> >
> > I assume the data with namespace meshv is in the default graph, and the
> > other data is in a specific named graph, but I am not sure how I have to
> > write the query to get the data in the named graphs.
> >
> > Thanks in advanced
> >
> >
> > Luis Ramos
> >
>


mesh ontology queries

2024-05-08 Thread Luis Enrique Ramos García
I uploaded the mesh ontology in fuseki,
but when I try with the query the sample queries recommended in their
documentation:
https://hhs.github.io/meshrdf/sample-queries

I get no results.

For instance:
PREFIX rdf: 
PREFIX rdfs: 
PREFIX xsd: 
PREFIX owl: 
PREFIX meshv: 
PREFIX mesh: 
PREFIX mesh2015: 
PREFIX mesh2016: 
PREFIX mesh2017: 
SELECT DISTINCT ?p
FROM 
WHERE {
?s ?p ?o
}
ORDER BY ?p

It gives me no results, but when I comment out the line with the FROM
clause, I get some results.

I assume the data with namespace meshv is in the default graph, and the
other data is in a specific named graph, but I am not sure how I have to
write the query to get the data in the named graphs.

Thanks in advanced


Luis Ramos


Training offer for SPARQL

2023-01-13 Thread Luis Enrique Ramos García
Dear All,

(with the permission of the administrators)
In our company we are interested in getting some practical training offers
for the application of the SPARQL in triplestores.
If any of you know a company or person who could provide this service,
please drop us a line.

Best regards


Luis Ramos


Re: How to deploy a scalable SPARQL Jena service ?

2023-01-08 Thread Luis Enrique Ramos García
Dear Nicolas,

I would be interested in getting more information about your approach,
should I contact you directly,

or could you provide such information by this way?.


Best regards


Luis Ramos













El lun, 9 ene 2023 a las 6:51, Nicholas Car () escribió:

> In case readers of this tread, or the list generally, are interested, we
> are testing out a virtual graph access control system that works nicely
> with Jena/Fuseki. We create Virtual Graphs that are Named Graphs with no
> content but are closures of other Named Graphs that do hold content. In
> this way, we can implement fancy access control - multiple users, groups
> and roles - to small graph parts, using just standard quad store elements +
> administration data holdings.
>
> So here you would break the larger graph into a Named Graph per governance
> unit - whatever your smallest conception of that is - and then build back
> up access to multiple Named Graphs via Virtual Graphs. All done in Fuseki
> back-end + access control API.
>
> Happy to share more details if anyone in interested here or directly.
>
> Cheers, Nick
>
> --
> Dr Nicholas Car
> Data Architect & Knowledge Graph Specialist
> Kurrawong AI
> n...@kurrawong.net
> 0477 560 177
> https://kurrawong.net
>
> Honorary Lecturer
> College of Engineering, Computing & Cybernetics
> Australian National University
> https://cecc.anu.edu.au/people/nicholas-car
>
> --
>
>
> --- Original Message ---
> On Monday, January 9th, 2023 at 07:01, Andy Seaborne 
> wrote:
>
>
> >
> > On 06/01/2023 15:37, Jonathan MERCIER wrote:
> >
> > > > Hi Jonathan,
> > >
> > > Hi Andy,
> > >
> > > > Could you say somnthing about the usage patterns you are interested
> in
> > > > supporting? Size of data? Query load?
> > >
> > > Yes of course, we aims to store Partially uniprot ontology in order to
> > > study metabolism on multiple layer
> Organism/Gene/Protein/Reaction/Pathway.
> > > Thus we will get a huge amount of public and private data (both
> academic
> > > research and industrial).
> > > So we have to use apache shiro to contol who can acces some data (by
> > > tenant)
> >
> >
> > Shiro will do the authentication and API security for authorization.
> >
> > To get the access control on parts of the overall data, do you split the
> > data into separate triplestores? Do you use the per-graph access control
> > of Jena to get data level security?
> >
> > The per-graph access control works if (1) you can manage the data that
> > way with named graphs and (2) the access control is user, or role, based.
> >
> > In dayjob, I'm working on another data access control system - we have
> > existing data which does not decompose into named graphs very easily and
> > the access control rules don't fit user/role bases (Role Based Access
> > Control = RBAC).
> >
> > Attribute Based Access Control (ABAC) can go down to labelling the
> > access conditions on individual triples - and also provides of simple
> > triple pattern matching (because sometimes, many triples have the same
> > label e.g. they have the same property).
> >
> > The "attribute" part comes from having key/value boolean expressions for
> > access conditions, such as "department=engineering & status=employee"
> > which can be moved around with the data when sharing across enterprise
> > boundaries.
> >
> > > Currently size of data is estimated around 1 To
> > > We will provides a Knowledge release time to time so we will most of
> > > time doing read only query and sometime we will push our new release (1
> > > To).
> >
> >
> > Then the full capabilities of RDF Delta may not be needed. Sounds like
> > offline database build, copy DB to multiple triple stores behind a load
> > balancer.
> >
> > Full 24x7 update with no single point of failure is nice but it is
> > complex. More servers (cost), more admin (more cost!).
> >
> > Or for a few not-time critical incremental updates, a simple mode for
> > RDF Delta is with a single patch manager with a replicated filesystem.
> > This is a single point of failure for updates, but the Fuseki replicas
> > can provide query service through-out. It is simpler to operate.
> >
> > Andy
> >
> > > > There is a Lucene based text index.
> > > > Indeed I see this I will take a look, on how to enable lucene with
> TDB
> > >
> > > Also we will take a look to the fuseki API in order to be able to use
> it
> > > through our python application (more rarely Kotlin)
> > >
> > > We aims to perform some GeoSpatial query (maybe we would have to make a
> > > plugin) in order to have a dedicated algorithm to walk though our
> > > knowledge graph
> > >
> > > > 2) can we deploy a distributed TDB service, in order to have
> efficient
> > > >  query ?
> > > >
> > > > It can scale sideways with multiple copies of the database kept
> > > > consistent across a cluster of replicas using the separate project
> (it
> > > > is not an Apache Foundation project) that provides high availability
> > > > and multiple query
> > > >
> > > > RD

Re: Demo of Fuseki in large-scale geo data production

2022-10-06 Thread Luis Enrique Ramos García
Congratulations!!!

great news.


Luis

El vie, 7 oct 2022 a las 8:19, Bruno Kinoshita ()
escribió:

> Hi Nick,
>
> It is looking really good! I wish (and hope) someone would do the same for
> NZ data (digitalNZ/Stats/at/etc). Looks like you used GeoSPARQL too, it is
> the first time I accessed a service with it (that was not just
> dev/research), I think.
>
> Great work!
>
> -Bruno
>
> On Fri, 7 Oct 2022 at 18:39, Nicholas Car  wrote:
>
> > Dear Jena users,
> >
> > I'm happy to announce that the Australian government now has a series of
> > large spatial datasets delivered as Linked Data via web APIs that use
> > Fuseki as the back end in production. This is the firts operation phase
> of
> > a long-term semantic spatial data layer for Australia.
> >
> > The data is significant: authoritative census counting geometries,
> > hydrological catchment areas and so on. The census spatial feature
> > collections are online at:
> >
> > https://asgs.linked.fsdf.org.au/dataset/asgsed3/collections
> >
> > A single census region:
> >
> https://asgs.linked.fsdf.org.au/dataset/asgsed3/collections/SA1/items/10102100710
> >
> > The largest dataset, the Geocoded National Address file, has 14.5M
> > addresses (all Australian street addresses) with perhaps 50 triples each
> > running well on a single GeoFuseki instance with GeoSPARQL indexing:
> >
> > Feature Collections:
> > https://gnaf.linked.fsdf.org.au/dataset/gnaf/collections
> > Address FC:
> > https://gnaf.linked.fsdf.org.au/dataset/gnaf/collections/addresses
> > Addresses:
> > https://gnaf.linked.fsdf.org.au/dataset/gnaf/collections/addresses/items
> > An Address object:
> >
> https://gnaf.linked.fsdf.org.au/dataset/gnaf/collections/addresses/items/GANSW718188625
> >
> > The data from these APIs provide the points-of-truth for national spatial
> > dataset object identity, e.g. the address above with the persistent IRI
> of:
> >
> > https://linked.data.gov.au/dataset/gnaf/address/GANSW718188625
> >
> > We are also testing the use of all the various datasets combined in a
> > Digital Atlas of Australia Analytics Platform. That will see complex
> SPARQL
> > qrieries posed against all the data with geospatial and text filtering,
> for
> > which we will soon implement Fuseki Lucene text indexes on top of the
> > GeoSPARQL indexes.
> >
> > We have spent a fair bit of time getting RDF generation from non-RDF
> > sources right, running RIOT tooling to check and load RDF data and to
> build
> > various indexes, mostly in AWS cloud infrastructure. We thank:
> >
> > * Stian Soiland-Reyes
> > * Zazuko
> > * Finland's Semantic Computing Research Group
> >
> > ...for their Fuseki containerisation that has made this relatively easy.
> >
> > Of course, we thank Andy Seabourne and the Apache Foundation for
> > Jena/Fuseki itself!
> >
> > Regards,
> >
> > Nicholas Car
> > n...@kurrawong.net
> >
> > David Habgood
> > dcchabg...@gmail.com
> >
>


Creating namedgraphs using fuseki UI.

2022-07-21 Thread Luis Enrique Ramos García
Dear All,

I would like to know if could be possible to create name graphs using
fuseki UI, as illustrated in this tutorial:

https://jena.apache.org/tutorials/sparql_datasets.html

In the tutorial, the name graphs are manipulated and queried, but I do not
know if I can upload the name graph to fuseki using the UI, or if it has to
be done with a curl command?. So, I can hold separate some specific graphs
or files.

Luis Ramos


Re: How to use Jena with Eclipse?

2022-06-20 Thread Luis Enrique Ramos García
Hi, you can also import your dependencies directly if you have a maven
project.

On Maven, add dependencies, and then type jena.

That brings you all dependencies related to jena. (eclipse).



Luis Ramos


El mar, 21 jun 2022 a las 8:19, Dương Hồ () escribió:

> Hi All.
> I want test use Jena with Eclipse, and now i'm following the instructions
> at https://jena.apache.org/tutorials/using_jena_with_eclipse.html?
> but i can't find the org.apache.jena.fuseki.cmd package and FusekiCmd file.
> Can you help me?
> [image: image.png]
>


Re: Apache Jena - 10 years as an Apache Project.

2022-04-18 Thread Luis Enrique Ramos García
Congratulations

El lun., 18 abr. 2022 18:40, Andy Seaborne  escribió:

> Today is the 10th anniversary of Apache Jena as a Top Level Project of
> the Apache Software Foundation!
>
>


Re: How to cite Jena?

2021-12-11 Thread Luis Enrique Ramos García
Hi,

I think this is the first paper of jena:

https://dl.acm.org/doi/10.1145/1013367.1013381

there you can get the citation.


Luis Ramos



El sáb, 11 dic 2021 a las 15:36, Jakub Jałowiec (<
j.jalow...@student.uw.edu.pl>) escribió:

> Hi,
> is there any preferred way to cite Apache Jena in a publication, preferably
> in BibTeX?
>
> Best regards,
> Jakub
>


Re: Apache Jena rules to find the minimum in a list of data property values

2021-12-05 Thread Luis Enrique Ramos García
Hi dear,

The issue here is the monotonic level of owl, with sparql functions you can
get this information, but with owl based rules, or inference not (in a set
larger than 2).

The point is that to get that the reasoner (or function) should create a
list, order it and extract the first or last element of the list.


Luis

El dom, 5 dic 2021 a las 14:24, Jakub Jałowiec (<
j.jalow...@student.uw.edu.pl>) escribió:

> Thanks, that solves the problem and I'll stick to it for now.
> Nonetheless, is it possible to automatically infer being an instance of the
> hypothetical class "YoungestPerson" ("the person with the lowest foaf:age
> aggregate by house") in Apache Jena as described above? Ideally, I would
> prefer to separate my conceptual/declarative model from raw data
> manipulation using SPARQL. I am new to RDF & ontologies and I am not sure
> to what extent keeping those two is possible and if it is worth to actually
> invest a lot of time into that.
>
> Best regards,
> Jakub
>
> niedz., 5 gru 2021 o 10:12 Lorenz Buehmann <
> buehm...@informatik.uni-leipzig.de> napisał(a):
>
> > Hi,
> >
> >
> > the common pattern in SPARQL is to get the aggregated value in an inner
> > query first, then in the outer query get the entity with the aggregated
> > value:
> >
> > SELECT ?house ?person ?lowestAge {
> >?person foaf:age ?lowestAge .
> >?person covidepid:livesIn ?house .
> >
> >
> > {SELECT ?house (min(?age) as ?lowestAge)
> > WHERE {
> >?person foaf:age ?age .
> >?person covidepid:livesIn ?house .
> > }
> > GROUP BY ?house}
> > }
> >
> >
> >
> > On 03.12.21 02:16, Jakub Jałowiec wrote:
> > > Hi,
> > > I would appreciate any help with the following problem. I have a bunch
> of
> > > (foaf:Persons, myOntology:livesIn, myOntology:Place) triples. I am
> trying
> > > to find the youngest person in each myOntology:Place (i.e. the person
> > with
> > > the earliest value of foaf:age for each myOntology:Place).
> > > What I've tried so far were:
> > > - OWL complex classes (Class Expression Syntax (
> protegeproject.github.io
> > )
> > > ) -
> > per
> > > my understanding they have too weak expressivity to express aggregates
> > > among other individuals associated with them
> > > - SPARQL query - something along those lines would work fine but I do
> not
> > > know how to retrieve the IRI of the youngest person:
> > >
> > >> SELECT ?house (min(?age) as ?lowestAge)
> > >> WHERE {
> > >>?person foaf:age ?age .
> > >>?person covidepid:livesIn ?house .
> > >> }
> > >> GROUP BY ?house
> > >
> > > I am curious if extraction of the lowest foaf:age value among a group
> of
> > > people could be achieved using Apache Jena rules. From the
> documentation
> > (
> > > https://jena.apache.org/documentation/inference/#rules) it seems to me
> > that
> > > the closest it gets to it is to write my custom built-in function that
> > > would do exactly that. Is that correct?
> > >
> > > Best regards,
> > > Jakub
> > >
> >
>


Re: OWL inferences in Apache Jena (for e.g. owl:allValuesFrom)

2021-12-05 Thread Luis Enrique Ramos García
Hi,

If I properly understand your notation, you are try to obtain an instance
as an inferred class.

In this case is CatPerson, a person who only has a pet of kind cat.

And, as I see you defined person_1, and you say he has a cat, then you
expect the system to infer he is a cat person, and return person_1 to you.

The point here, and hope to be corrected by anybody else if I am wrong, is
that you are using sparql, which is rdf based. Then, you can only query

asserted, not inferred knowledge.

Some engines like blazegraph, let you add owl reasoning, and then you can
use the transitive feature of owl  (comment only as example).

I do not know whether or not fuseki can be configured in such a way.


Luis Ramos


El dom, 5 dic 2021 a las 15:38, Jakub Jałowiec (<
j.jalow...@student.uw.edu.pl>) escribió:

> Hi,
> I have an OWL ontology
> https://github.com/kubajal/covidepid/blob/main/minimal_test.ttl.
> The ontology has the following definitions:
>
> >
> >- Person
> >   - CatPerson (subClassOf Person + CatPerson equivalentTo hasPet only
> >   Cat)
> >- Animal
> >   - Cat (subClassOf Animal)
> >- hasPet: Person -> Animal
> >
> > and the following instances:
>
> >
> >- person_1: Person and (hasPet only {cat_1})
> >- cat_1: Cat
> >- hasPet(person_1, cat_1)
> >
> > I am using Apache Jena Fuseki 4.2.0 with the OWLFBRuleReasoner reasoner
> (link to the configuration:
> https://github.com/kubajal/covidepid/blob/main/minimal_test_config.ttl).
>
> I am executing the following query in Fuseki:
>
> > PREFIX rdf: 
> > PREFIX myOnt: <
> >
> http://www.semanticweb.org/kubajal/ontologies/2021/11/untitled-ontology-157/
> > >
>
> SELECT ?s {
> > ?s rdf:type myOnt:CatPerson .
> > }
>
>
> No results are returned whereas I would expect person_1 to be returned (as
> it is the case in e.g. Protege using Pellet).
> I am using
>
> https://jena.apache.org/documentation/ontology/#more-complex-class-expressions
> as documentation which says that the "all values from" construct is
> supported  (so e.g. "CatPerson equivalentTo hasPet only Cat" should work).
> Am I missing something?
>
> Best regards,
> Jakub
>


abox, tbox for owl in jena

2021-11-04 Thread Luis Enrique Ramos García
Dear All,

I found this information regarding the use of the so called ABox and TBox
with a reasoner in Jena:
https://jena.apache.org/documentation/ontology/

However, I wonder if there is the possibility, after creating and
populating an ontology with instances, to split the ontology in abox,
tbox?.

I also wonder if loading these separated graphs to a reasoner should be
more or less efficient in computational terms, in comparison to loading
both ( ABox and TBox ) just in only one file or ontology?, or does it not
make any difference?

Best regards


Luis Ramos


Re: fuseki and shiro.ini

2021-08-24 Thread Luis Enrique Ramos García
Hi Andy,

Thanks for your quick answer, I could confirm that shiro.ini is loaded, but
at the end I could create my dataset with  curl command:
curl "http://localhost:3030/$/datasets?dbType=tdb&dbName=test1"; -X POST),
with ssh connection

load data and query it, that solved initially my issue for testing and
demonstration purpose.  :-)


Luis Ramos





El mar, 24 ago 2021 a las 0:22, Andy Seaborne () escribió:

> Hi there,
>
> That shiro.ini looks right. It can be tricky to make sure it is active.
> If it is the standalone server, it will need a restart to see the
> changed file in the run/ area. Or is this the war file?
>
> The create step could be achieved by ssh to the VM and executing curl
> locally.
>
> Or using a configuration file on startup and not dynamically creating
> the dataset.
>
> The data loading isn't an admin operation - just POST to the "/dataset"
> endpoint in the normal setup.
>
>  Andy
>
> On 23/08/2021 13:11, Luis Enrique Ramos García wrote:
> > Dear All,
> >
> > I installed fuseki in a virtual server, and when I tried to load a
> dataset
> > I realized it has some security setup.
> >
> > I found some indications here:
> > https://jena.apache.org/documentation/fuseki2/fuseki-security.html
> > and modified my shiro.ini as follows:
> >
> > *shiro.ini
> >
> > [main]
> > localhost=org.apache.jena.fuseki.authz.LocalhostFilter
> >
> > [urls]
> > ## Control functions open to anyone
> > /$/server = anon
> > /$/ping   = anon
> > /$/datasets = anon
> > ## and the rest are restricted to localhost.
> > ## See above for 'localhost'
> > /$/** = anon
> > /**=anon
> >
> > ***
> >
> > Now, when I try the following endpoints with postman:
> > get mypi/$/ping
> > get myip/$/server
> >
> > I obtain the expected result, but when I try the following:
> > get mypi/$/datasets/
> > post myip/$/datasets/{name}
> >
> > I get *Error 403: Forbidden.*
> >
> >
> > Thus, I wonder how I have to configure shiro.ini in order to let any user
> > to create datasets and load data?. Moreover, I wonder what should be the
> > right method to load datasets remotely?.
> >
> >
> > Best regards
> >
> >
> > Luis Ramos
> >
>


fuseki and shiro.ini

2021-08-23 Thread Luis Enrique Ramos García
Dear All,

I installed fuseki in a virtual server, and when I tried to load a dataset
I realized it has some security setup.

I found some indications here:
https://jena.apache.org/documentation/fuseki2/fuseki-security.html
and modified my shiro.ini as follows:

*shiro.ini

[main]
localhost=org.apache.jena.fuseki.authz.LocalhostFilter

[urls]
## Control functions open to anyone
/$/server = anon
/$/ping   = anon
/$/datasets = anon
## and the rest are restricted to localhost.
## See above for 'localhost'
/$/** = anon
/**=anon

***

Now, when I try the following endpoints with postman:
get mypi/$/ping
get myip/$/server

I obtain the expected result, but when I try the following:
get mypi/$/datasets/
post myip/$/datasets/{name}

I get *Error 403: Forbidden.*


Thus, I wonder how I have to configure shiro.ini in order to let any user
to create datasets and load data?. Moreover, I wonder what should be the
right method to load datasets remotely?.


Best regards


Luis Ramos


Re: Ontology

2021-08-19 Thread Luis Enrique Ramos García
Hi,

I recommend the book Ontology Engineering by Gomez Perez, which is good to
begin with.


Luis

El jue, 19 ago 2021 a las 21:30, Matt Whitby ()
escribió:

> This will be off-topic but I believe you're the best group of people to ask
> this to. We need to look at our various datasets and start to put together
> an ontology. Does anyone have any suggestions on books to read, videos to
> watch, or any general advice or pitfalls to avoid?
>
> Thanks,
> Matt.
>


Re: Path between two nodes

2020-08-10 Thread Luis Enrique Ramos García
HI Ahmed,

Although the task of  finding a path between two nodes is very common
terminology used in graphdb, it is worth remembering that rdf, rdfs and owl
(ann ontologies) are graph based approaches, and therefore graph principles
can be applied to them.

Of course, there are some specific differences, some are terminologicals,
some others are based on the kind of graph, because for example we do not
use the terms nodes and path regularly, we say for instance classes and
relations between classes. So, using jena we can find all subclasses of a
given class recursively, and then get all subclasses that are connected to
that root class. Similarly you can find the "path" of a given relation
starting in an individual (or node), and going through all individuals
connected to the first one by this relation.

Best regards

Luis





El lun., 10 ago. 2020 a las 19:52, Ahmed Helal (<
ahmed.he...@mail.concordia.ca>) escribió:

> Greetings,
>
> I am now working on a project involving Apache Jena. I would like to ask
> if Jena supports finding a path between two nodes.
>
> Thank you for your time,
> Ahmed Helal.
>


Re: benchmark results

2020-05-06 Thread Luis Enrique Ramos García
Hi Hashim,

Thanks for the information, could ou please tell me the size of the data
set in bytes,


Luis

El mié., 6 may. 2020 a las 23:59, Hashim Khan ()
escribió:

> -- Forwarded message -
> From: Hashim Khan 
> Date: Wed 6 May 2020 18:12
> Subject: benchmark results
> To: , 
>
>
> Hi,
> I have some benchmark results for academic purpose. Since I have to publish
> these results for academic purpose, therefore, ethically I should approve
> it from you. Please have a look on it and comment. The experiments are
> performed for testing Jena Fuseki for throughput in the form of
> Queries-per-Second (QpS) by concurrent querying users. Results are as
> follows:
>
> ---
> Queries-per-Second (QpS) value (on right) against number of querying user/s
> on left. Dataset used in WatDiv and its corresponding generated queries.
>
>
> *1 user* *16.3095428042943*
> *2* *28.7767042229086*
> *4* *37.7873613755524*
> *8* *41.4869801140127*
> *16* *40.3444765286102*
> *32* *18.2336058348627*
> *64* *4.99362748348325*
> *128* *3.14705862217391*
>
> ---
> Queries-per-Second (QpS) value (on right) against number of querying user/s
> on left. Dataset used in DBpedia3.5.1, with FEASIBLE benchmark generated
> queries.
>
> *1 user* *34.2716918435139*
> *2* *41.4967058060893*
> *4* *46.133575439712*
> *8* *90.7590012425525*
> *16* *23.324348385717*
> *32* *0.184894512966109*
> *64* *0.000185155317588*
> *128* *0.004903533091092*
>
>  
> -
> Further details are;
>
> WatDiv generated dataset  having 108M triples source:
> https://dsg.uwaterloo.ca/watdiv/
> and the corresponding queries generated by Query Generator tool of the same
> source.
>
> DBpedia3.5.1 dataset having about 280M triples source: *dbpedia.org
> *
> with FEASIBEL Benchmark queries source:
> https://link.springer.com/chapter/10.1007/978-3-319-25007-6_4
>
> Benchmark execution framwork IGUANA source:
> https://github.com/dice-group/IGUANA
> is used.
>
> All experiments were performed on a machine with 32 X Intel(R) Xeon(R) CPU
> @ 2.10GHz, 256GB RAM, 4TB HDD and running Ubuntu 4.18.0-25-generic.
>
> Jena-TDB (Fuseki) Version 2.0 with a Java heap size set to 16GB,
>
> -- I will be waiting for your reply.
>
>
>
> Best Regards,
> --
> *Hashim Khan*
>


Re: subproperty as qualifiers

2020-04-22 Thread Luis Enrique Ramos García
Hi Andy,

Thanks for your answer, then for next release?

For now, I am following my previous procedure to test if I reach the goal


Luis

El mié., 22 abr. 2020 a las 12:11, Andy Seaborne ()
escribió:

>
>
> On 21/04/2020 10:21, Lorenz Buehmann wrote:
> > What is a "qualifier" in RDF?
> >
> > You should look at the Wikidata data model, they are using such a
> > concept which is basically done via some kind of reification on the
> > statements (triples). Their approach is very thorough, you might reuse
> > it for your data.
> >
> > That said, I'd also point you to RDF* which Andy added quite recently
> > and will be part of next release (@Andy I guess? )
>
> Yes - as an experimental version working for in-memory storage.
>
>  Andy
>
> >
> > On 21.04.20 11:17, Luis Enrique Ramos García wrote:
> >> Dear friends,
> >>
> >> I am trying to model a relation between two individuals, in this case
> two
> >> companies, and the relations is the ownership represented in percentage
> as
> >> a value of shares. For instance, I could say.
> >> c1 is_Owner_of c2
> >>
> >> c2 shares *60 %* of c2
> >>
> >> I have done a similar modeling using a class to represent shares, but I
> >> wonder if it could be possible to use a subproperty as qualifier?
> >>
> >> I mean to say:
> >>
> >> c1 is_Owner_of c2  - and is_Owner_of : share 60
> >>
> >>
> >> I have tried to perform such modeling, but it has not been possible.
> >>
> >> Then, I wonder if it is possible to declare a sub property as a
> qualifier
> >> in jena?
> >>
> >>
> >>
> >> Luis Ramos
> >>
>


Re: Advice on RDFS versus OWL DL, OntModel Profiles?

2020-04-21 Thread Luis Enrique Ramos García
Dear Steve,

from the questions you posted, I am going to try to answer this part:




*If so, is there some way to make a simple selection between
OWL_LITE,OWL_DL, and OWL_FULL Profiles somewhere, analogous to the way
differentreasoners can be selected?*

As i understood from documentation of jena [1],  they have partial
implementation of OWL in the reasoners they provide, that means you have to
check carefully the provided table to determine if the constructors you
require are implemented.
and the recommend to use an external reasoner for owl dl.

All available reasoners are in the reference, unless there is a more recent
information.


Bets regards


Luis Ramos

[1] https://jena.apache.org/documentation/inference/







El dom., 19 abr. 2020 a las 16:16, Steve Vestal (<
steve.ves...@adventiumlabs.com>) escribió:

> I have some owl:Ontology documents from different sources.  One uses
> rdfs:Class and the other owl:Class.  When I glance at the standards, it
> says these are equivalent in OWL Full but not in OWL DL.  There is a
> discussion about this in the section "Ontology languages and the Jena
> Ontology API" in the online Jena documentation.
>
> My testing indicates that OntModel#listClasses and
> OntModel#listNamedClasses will list things typed owl:Class but not
> rdfs:Class.  This appears true regardless of the OntModelSpec chosen for
> a reasoner, e.g., OWL_MEM_RDFS_INF, OWL_MEM_MICRO_RULE_INF,
> OWL_DL_MEM_RULE_INF, all exhibit this behavior.
>
> I see there is are OntModel#getProfile and OntModelSpec#getProfile
> methods, but a hasty search did not turn up companion setProfile methods.
>
> Two specific questions:
>
> Is this the expected behavior for OntModel#listClasses and
> OntModel#listNamedClasses?  Or is there something I'm missing?
>
> If so, is there some way to make a simple selection between OWL_LITE,
> OWL_DL, and OWL_FULL Profiles somewhere, analogous to the way different
> reasoners can be selected?
>
> To fish a bit, I would appreciate any experience and suggestions on
> variations in ontologies obtained from different sources.  How many
> owl:Ontology documents (ABox and TBox) turn out have a fair degree of
> variability in which specific forms of assertions they contain?  How
> robust or sensitive are or can applications be from a user perspective
> w.r.t. variations and mixtures of profiles and choice of reasoner?
>
> (If you are curious, this came up when looking at the OSLC standard
> vocabularies.  As near as I can tell, Protege will show the classes but
> restricts itself to displaying object and data properties.)
>
>
>


Re: subproperty as qualifiers

2020-04-21 Thread Luis Enrique Ramos García
Thank for your answer Lorenz,

I am currently working with wikidata, providing a reasoning layer to it
with jena, and I have been able to model its "qualifiers" with
successful results, however, I was wondering if it could use a
subproperty as qualifier, just as the people of wikidata does.


Thanks a lot


Luis Ramos

El mar., 21 abr. 2020 a las 11:21, Lorenz Buehmann (<
buehm...@informatik.uni-leipzig.de>) escribió:

> What is a "qualifier" in RDF?
>
> You should look at the Wikidata data model, they are using such a
> concept which is basically done via some kind of reification on the
> statements (triples). Their approach is very thorough, you might reuse
> it for your data.
>
> That said, I'd also point you to RDF* which Andy added quite recently
> and will be part of next release (@Andy I guess? )
>
> On 21.04.20 11:17, Luis Enrique Ramos García wrote:
> > Dear friends,
> >
> > I am trying to model a relation between two individuals, in this case two
> > companies, and the relations is the ownership represented in percentage
> as
> > a value of shares. For instance, I could say.
> > c1 is_Owner_of c2
> >
> > c2 shares *60 %* of c2
> >
> > I have done a similar modeling using a class to represent shares, but I
> > wonder if it could be possible to use a subproperty as qualifier?
> >
> > I mean to say:
> >
> > c1 is_Owner_of c2  - and is_Owner_of : share 60
> >
> >
> > I have tried to perform such modeling, but it has not been possible.
> >
> > Then, I wonder if it is possible to declare a sub property as a qualifier
> > in jena?
> >
> >
> >
> > Luis Ramos
> >
>


subproperty as qualifiers

2020-04-21 Thread Luis Enrique Ramos García
Dear friends,

I am trying to model a relation between two individuals, in this case two
companies, and the relations is the ownership represented in percentage as
a value of shares. For instance, I could say.
c1 is_Owner_of c2

c2 shares *60 %* of c2

I have done a similar modeling using a class to represent shares, but I
wonder if it could be possible to use a subproperty as qualifier?

I mean to say:

c1 is_Owner_of c2  - and is_Owner_of : share 60


I have tried to perform such modeling, but it has not been possible.

Then, I wonder if it is possible to declare a sub property as a qualifier
in jena?



Luis Ramos


Re: issue trying to query wikidata with jena api

2020-04-09 Thread Luis Enrique Ramos García
Andy,

In addition I am working in another end point, and now I am getting this
output:

Endpoint returned Content-Type: text/html which is not rcognized for SELECT
queries

I followed this recommendation

https://stackoverflow.com/questions/41926530/jena-endpoint-returned-content-type-text-html


however the behavior does not change, and I continue receiving this error:

Exception in thread "main" org.apache.jena.query.QueryException: Endpoint
returned Content-Type: text/html which is not rcognized for SELECT queries
at
org.apache.jena.sparql.engine.http.QueryEngineHTTP.execResultSetInner(QueryEngineHTTP.java:377)
at
org.apache.jena.sparql.engine.http.QueryEngineHTTP.execSelect(QueryEngineHTTP.java:345)
at
ag.pst.jena.test.RDFConnectionExample4.main(RDFConnectionExample4.java:84)

any recommendation?


Luis

El jue., 9 abr. 2020 a las 15:03, Andy Seaborne ()
escribió:

> > "SELECT ?item1  WHERE {\n" +
> > "?item1 wdt:P31 ?item2.\n" +
> > "} LIMIT 10";
>
>
> > qs1.getResource("s")
>
> The variable is called "item1"
>
>  qs1.getResource("item1")
>
>   Andy
>
> On 09/04/2020 13:47, Luis Enrique Ramos García wrote:
> > dear member of jena community,
> >
> > I have been trying to query wikidata following the documentation [1] and
> > other examples I have found, but result obtained has been null values,
> > besides it is a simple query, that I have just previously tested in the
> > wikidata query GUI.
> >
> > I followed two methods, one with  QueryExecution, and another
> > with RDFConnectionRemote, but however in both the output is null as well.
> >
> > Please, let me know if I am missing something, or if I am going in the
> > wrong direction.
> >
> >
> > Best regards
> >
> >
> >
> > Luis Ramos
> >
> >
> > *CODE *
> >
> >
> >
> > import org.apache.jena.query.Query;
> > import org.apache.jena.query.QueryExecution;
> > import org.apache.jena.query.QueryExecutionFactory;
> > import org.apache.jena.query.QueryFactory;
> > import org.apache.jena.query.QuerySolution;
> > import org.apache.jena.query.ResultSet;
> > import org.apache.jena.rdf.model.Resource;
> > import org.apache.jena.rdfconnection.RDFConnection;
> > import org.apache.jena.rdfconnection.RDFConnectionFactory;
> > import org.apache.jena.rdfconnection.RDFConnectionRemote;
> > import org.apache.log4j.BasicConfigurator;
> > import org.apache.log4j.Level;
> > import org.apache.log4j.Logger;
> >
> >
> >
> >
> > /*
> >   * Example of a building a remote connection.
> >
> >   */
> > public class RDFConnectionExample4 {
> >
> > //testing
> > static Logger log = Logger.getLogger(RDFConnectionExample4.class);
> >
> >
> >
> >
> >  public static void main(String ...args) {
> >
> >  log.setLevel(Level.INFO);
> >  log.info("This is Luis Logger");
> > BasicConfigurator.configure();
> >
> >
> >
> >  String my_query = "PREFIX schema: <http://schema.org/>\n" +
> >  "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\n" +
> >  "PREFIX owl: <http://www.w3.org/2002/07/owl#>\n" +
> >  "PREFIX hist: <http://wikiba.se/history/ontology#>\n" +
> >  "PREFIX wd: <http://www.wikidata.org/entity/>\n" +
> >  "PREFIX wdt: <http://www.wikidata.org/prop/direct/>\n" +
> >  "PREFIX wikibase: <http://wikiba.se/ontology#>\n" +
> >  "PREFIX dct: <http://purl.org/dc/terms/>\n" +
> >  "\n" +
> >  "SELECT ?item1  WHERE {\n" +
> >  "?item1 wdt:P31 ?item2.\n" +
> >  "} LIMIT 10";
> >
> > System.out
> >
> > .println("The query string is"+ my_query);
> >
> >  Query query = QueryFactory.create(my_query);
> >
> >  //method 1 with query execution
> >
> >  QueryExecution qe1 = QueryExecutionFactory.sparqlService("
> > https://query.wikidata.org/sparql";, query);
> >
> >  ResultSet rs1 = qe1.execSelect() ;
> >
> >  while(rs1.hasNext()) {
> >  QuerySolution qs1 = rs1.next() ;
> >  Resource subject1 = qs1.getResource("s") ;
> >  System.out.println("Subject: "+subject1) ;
> >  }
> >
> >  //method 2
> >
> >
> >
>

Re: issue trying to query wikidata with jena api

2020-04-09 Thread Luis Enrique Ramos García
solved! 🙄



Luis

El jue., 9 abr. 2020 a las 15:03, Andy Seaborne ()
escribió:

> > "SELECT ?item1  WHERE {\n" +
> > "?item1 wdt:P31 ?item2.\n" +
> > "} LIMIT 10";
>
>
> > qs1.getResource("s")
>
> The variable is called "item1"
>
>  qs1.getResource("item1")
>
>   Andy
>
> On 09/04/2020 13:47, Luis Enrique Ramos García wrote:
> > dear member of jena community,
> >
> > I have been trying to query wikidata following the documentation [1] and
> > other examples I have found, but result obtained has been null values,
> > besides it is a simple query, that I have just previously tested in the
> > wikidata query GUI.
> >
> > I followed two methods, one with  QueryExecution, and another
> > with RDFConnectionRemote, but however in both the output is null as well.
> >
> > Please, let me know if I am missing something, or if I am going in the
> > wrong direction.
> >
> >
> > Best regards
> >
> >
> >
> > Luis Ramos
> >
> >
> > *CODE *
> >
> >
> >
> > import org.apache.jena.query.Query;
> > import org.apache.jena.query.QueryExecution;
> > import org.apache.jena.query.QueryExecutionFactory;
> > import org.apache.jena.query.QueryFactory;
> > import org.apache.jena.query.QuerySolution;
> > import org.apache.jena.query.ResultSet;
> > import org.apache.jena.rdf.model.Resource;
> > import org.apache.jena.rdfconnection.RDFConnection;
> > import org.apache.jena.rdfconnection.RDFConnectionFactory;
> > import org.apache.jena.rdfconnection.RDFConnectionRemote;
> > import org.apache.log4j.BasicConfigurator;
> > import org.apache.log4j.Level;
> > import org.apache.log4j.Logger;
> >
> >
> >
> >
> > /*
> >   * Example of a building a remote connection.
> >
> >   */
> > public class RDFConnectionExample4 {
> >
> > //testing
> > static Logger log = Logger.getLogger(RDFConnectionExample4.class);
> >
> >
> >
> >
> >  public static void main(String ...args) {
> >
> >  log.setLevel(Level.INFO);
> >  log.info("This is Luis Logger");
> > BasicConfigurator.configure();
> >
> >
> >
> >  String my_query = "PREFIX schema: <http://schema.org/>\n" +
> >  "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\n" +
> >  "PREFIX owl: <http://www.w3.org/2002/07/owl#>\n" +
> >  "PREFIX hist: <http://wikiba.se/history/ontology#>\n" +
> >  "PREFIX wd: <http://www.wikidata.org/entity/>\n" +
> >  "PREFIX wdt: <http://www.wikidata.org/prop/direct/>\n" +
> >  "PREFIX wikibase: <http://wikiba.se/ontology#>\n" +
> >  "PREFIX dct: <http://purl.org/dc/terms/>\n" +
> >  "\n" +
> >  "SELECT ?item1  WHERE {\n" +
> >  "?item1 wdt:P31 ?item2.\n" +
> >  "} LIMIT 10";
> >
> > System.out
> >
> > .println("The query string is"+ my_query);
> >
> >  Query query = QueryFactory.create(my_query);
> >
> >  //method 1 with query execution
> >
> >  QueryExecution qe1 = QueryExecutionFactory.sparqlService("
> > https://query.wikidata.org/sparql";, query);
> >
> >  ResultSet rs1 = qe1.execSelect() ;
> >
> >  while(rs1.hasNext()) {
> >  QuerySolution qs1 = rs1.next() ;
> >  Resource subject1 = qs1.getResource("s") ;
> >  System.out.println("Subject: "+subject1) ;
> >  }
> >
> >  //method 2
> >
> >
> >
> >
> >   RDFConnection conn0 = RDFConnectionRemote.create()
> >  .destination("https://query.wikidata.org/";)
> >  .queryEndpoint("sparql")
> >  // Set a specific accept header; here, sparql-results+json
> > (preferred) and text/tab-separated-values
> >   //The default is "application/sparql-results+json,
> > application/sparql-results+xml;q=0.9, text/tab-separated-values;q=0.7,
> > text/csv;q=0.5, application/json;q=0.2, application/xml;q=0.2, */*;q=0.1"
> > .acceptHeaderSelectQuery("application/sparql-results+json,
> > application/sparql-results+xml;q=0.9")
> > .build();
> >
> >
> >  String queryService = "https://query.wikidata.org/sparql?";;
> >
> >  RDFConnection conn = RDFConnectionFactory.connect(queryService,
> > null, null);
> >
> >  QueryExecution qe2 = conn.query(query);
> >
> >  ResultSet rs2 = qe2.execSelect() ;
> >
> >  while(rs2.hasNext()) {
> >  QuerySolution qs2 = rs2.next() ;
> >  Resource subject2 = qs2.getResource("s") ;
> >  System.out.println("Subject: "+subject2) ;
> >  }
> >
> >
> >
> > // QueryExecution qExec = conn.query(query);
> >
> >
> >  }
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > https://jena.apache.org/documentation/rdfconnection/
> >
>


issue trying to query wikidata with jena api

2020-04-09 Thread Luis Enrique Ramos García
dear member of jena community,

I have been trying to query wikidata following the documentation [1] and
other examples I have found, but result obtained has been null values,
besides it is a simple query, that I have just previously tested in the
wikidata query GUI.

I followed two methods, one with  QueryExecution, and another
with RDFConnectionRemote, but however in both the output is null as well.

Please, let me know if I am missing something, or if I am going in the
wrong direction.


Best regards



Luis Ramos


*CODE *



import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryExecutionFactory;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.query.QuerySolution;
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdfconnection.RDFConnection;
import org.apache.jena.rdfconnection.RDFConnectionFactory;
import org.apache.jena.rdfconnection.RDFConnectionRemote;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;




/*
 * Example of a building a remote connection.

 */
public class RDFConnectionExample4 {

//testing
static Logger log = Logger.getLogger(RDFConnectionExample4.class);




public static void main(String ...args) {

log.setLevel(Level.INFO);
log.info("This is Luis Logger");
BasicConfigurator.configure();



String my_query = "PREFIX schema: \n" +
"PREFIX xsd: \n" +
"PREFIX owl: \n" +
"PREFIX hist: \n" +
"PREFIX wd: \n" +
"PREFIX wdt: \n" +
"PREFIX wikibase: \n" +
"PREFIX dct: \n" +
"\n" +
"SELECT ?item1  WHERE {\n" +
"?item1 wdt:P31 ?item2.\n" +
"} LIMIT 10";

   System.out

.println("The query string is"+ my_query);

Query query = QueryFactory.create(my_query);

//method 1 with query execution

QueryExecution qe1 = QueryExecutionFactory.sparqlService("
https://query.wikidata.org/sparql";, query);

ResultSet rs1 = qe1.execSelect() ;

while(rs1.hasNext()) {
QuerySolution qs1 = rs1.next() ;
Resource subject1 = qs1.getResource("s") ;
System.out.println("Subject: "+subject1) ;
}

//method 2




 RDFConnection conn0 = RDFConnectionRemote.create()
.destination("https://query.wikidata.org/";)
.queryEndpoint("sparql")
// Set a specific accept header; here, sparql-results+json
(preferred) and text/tab-separated-values
 //The default is "application/sparql-results+json,
application/sparql-results+xml;q=0.9, text/tab-separated-values;q=0.7,
text/csv;q=0.5, application/json;q=0.2, application/xml;q=0.2, */*;q=0.1"
   .acceptHeaderSelectQuery("application/sparql-results+json,
application/sparql-results+xml;q=0.9")
   .build();


String queryService = "https://query.wikidata.org/sparql?";;

RDFConnection conn = RDFConnectionFactory.connect(queryService,
null, null);

QueryExecution qe2 = conn.query(query);

ResultSet rs2 = qe2.execSelect() ;

while(rs2.hasNext()) {
QuerySolution qs2 = rs2.next() ;
Resource subject2 = qs2.getResource("s") ;
System.out.println("Subject: "+subject2) ;
}



   // QueryExecution qExec = conn.query(query);


}












https://jena.apache.org/documentation/rdfconnection/


Re: unexpected output in rule

2020-03-18 Thread Luis Enrique Ramos García
Hi Dave,

Thanks for your support, for now I am working with the rules as it is
triggering, my use of rules is because of customer requirements. I will
test with sparql this first stage of my work in order to make performance
comparison.


Bets regards


Luis Ramos

El lun., 16 mar. 2020 a las 16:59, Dave Reynolds ()
escribió:

> Hi Luis,
>
> On 16/03/2020 09:41, Luis Enrique Ramos García wrote:
> > Hi again Dave,
> >
> > sorry if I have not explained appropriately,
> >
> > let me tell you at first my goal: I am inspecting a dataset of 1,5
> millions
> > individuals, againts another dataset with 5k *search_ID *values, where I
> > have  to get an individual with a given value in a property. I use rule 2
> > with search_ID in *registration_Authority_entity_ID* property, in order
> to
> > identify individuals with search_ID value. I think rule 2 could be
> > rewritten as follows:
> >
> > rule 2=  (?b rdf_ns:type   Entity)  (?b registration_Authority_entity_ID
> "
> > *search_ID'*) -> (?b has_ord ?ord)
> >
> >   rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns";
> >   rdf_ns = rdf+"#"
>
> Unclear why you are using rules for rather than simply a Sparql query.
>
> That example is *still* not a legal rule syntax.
>
> > In my experience with owl api, when a rule is triggered, no change
> occurred
> > in the original data, that means rule does not affect original model, and
> > an inferred model is generated, and this model can be store separated.
>
> Um, this is Jena not the OWL API. It is true that if a forward rule
> fires the result of the rule will be asserted in the deductions model.
>
> > When
> > I trigger rule 2, I obtained this inferred model, and when I inspect it,
> I
> > can see the individual with the property value, but wrong,
>
> Not sure what you mean by "wrong". It's doing what it is supposed to do.
> You haven't bound ?ord so it can't assert a value for it in the
> deductions model.
>
> > in the same way,
> > when I execute rule 1, I do not obtain any result, and model holds
> blank. I
> > code the necessary control element to verify that inferred model of rule
> 1
> > holds blank, in other words I confirm that there is not triggering.
>
> I repeat, if you can't get your rule 1 to fire and you still need help
> then show us actual minimal test data (need only be a few statements,
> sufficient to match the rule) and actual rule syntax not isolated
> fragments of your source code with key values missing. The chances are
> you have a namespace/URI error somewhere.
>
> Dave
>
> > Currently I am executing the following rule:
> >
> > rule_3 = (?b rdf_ns:type Entity)  (?b registration_Authority_entity_ID
> > *search_ID*) -> (?b rdf_ns:type Entity)
> >
> > So, I obtain all ?b individuals with value search_ID, however I require
> > extra work to obtain the target property value, that will let me identify
> > my individual later, and I think I should be able to get it with the
> rule.
> >
> >
> > Hope this could clarify a little more my use case.
> >
> >
> > Luis Ramos
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > El lun., 16 mar. 2020 a las 10:04, Dave Reynolds (<
> dave.e.reyno...@gmail.com>)
> > escribió:
> >
> >>
> >> On 16/03/2020 08:49, Luis Enrique Ramos García wrote:
> >>> Hi Dave,
> >>>
> >>> thanks for your quick response,
> >>>
> >>> I though that was the cause of the problem, however when I add the bind
> >> to
> >>> ?ord in the body, then the rule is not triggered , I changed  as in
> rule
> >> 1:
> >>>
> >>>
> >>> String rule 1=  (?b rdf_ns:type  GLEIF1_NS Entity)  (?b GLEIF1_NS
> has_ord
> >>> ?ord) (?b GLEIF1_NS registration_Authority_entity_ID "search_ID') ->
> (?b
> >>> GLEIF1_NS has_ord ?ord)
> >>
> >> What's that supposed to do? You seem to be binding ?ord then asserting
> >> the same value back again. So that will have no effect on the data.
> >>
> >>> String rule 2=  (?b rdf_ns:type  GLEIF1_NS Entity)  (?b GLEIF1_NS
> >>> registration_Authority_entity_ID "search_ID') -> (?b GLEIF1_NS has_ord
> >> ?ord)
> >>
> >> What's that supposed to do? There's no binding for ?ord so why would you
> >> expect it to have a specific value?
> >>
> >>> as shown above the rule

Re: unexpected output in rule

2020-03-16 Thread Luis Enrique Ramos García
Hi again Dave,

sorry if I have not explained appropriately,

let me tell you at first my goal: I am inspecting a dataset of 1,5 millions
individuals, againts another dataset with 5k *search_ID *values, where I
have  to get an individual with a given value in a property. I use rule 2
with search_ID in *registration_Authority_entity_ID* property, in order to
identify individuals with search_ID value. I think rule 2 could be
rewritten as follows:

rule 2=  (?b rdf_ns:type   Entity)  (?b registration_Authority_entity_ID "
*search_ID'*) -> (?b has_ord ?ord)

 rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns";
 rdf_ns = rdf+"#"


In my experience with owl api, when a rule is triggered, no change occurred
in the original data, that means rule does not affect original model, and
an inferred model is generated, and this model can be store separated. When
I trigger rule 2, I obtained this inferred model, and when I inspect it, I
can see the individual with the property value, but wrong, in the same way,
when I execute rule 1, I do not obtain any result, and model holds blank. I
code the necessary control element to verify that inferred model of rule 1
holds blank, in other words I confirm that there is not triggering.

Currently I am executing the following rule:

rule_3 = (?b rdf_ns:type Entity)  (?b registration_Authority_entity_ID
*search_ID*) -> (?b rdf_ns:type Entity)

So, I obtain all ?b individuals with value search_ID, however I require
extra work to obtain the target property value, that will let me identify
my individual later, and I think I should be able to get it with the rule.


Hope this could clarify a little more my use case.


Luis Ramos











El lun., 16 mar. 2020 a las 10:04, Dave Reynolds ()
escribió:

>
> On 16/03/2020 08:49, Luis Enrique Ramos García wrote:
> > Hi Dave,
> >
> > thanks for your quick response,
> >
> > I though that was the cause of the problem, however when I add the bind
> to
> > ?ord in the body, then the rule is not triggered , I changed  as in rule
> 1:
> >
> >
> > String rule 1=  (?b rdf_ns:type  GLEIF1_NS Entity)  (?b GLEIF1_NS has_ord
> > ?ord) (?b GLEIF1_NS registration_Authority_entity_ID "search_ID') -> (?b
> > GLEIF1_NS has_ord ?ord)
>
> What's that supposed to do? You seem to be binding ?ord then asserting
> the same value back again. So that will have no effect on the data.
>
> > String rule 2=  (?b rdf_ns:type  GLEIF1_NS Entity)  (?b GLEIF1_NS
> > registration_Authority_entity_ID "search_ID') -> (?b GLEIF1_NS has_ord
> ?ord)
>
> What's that supposed to do? There's no binding for ?ord so why would you
> expect it to have a specific value?
>
> > as shown above the rule 1 does not trigger, rule 2 does trigger as
> > expected, but the output value does not corresponds to the value of
> ?ord. I
> > obtained this value > *ae791d81-7538-49ac-9436-898ede09d7b5*], and should
> > have been >
> ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID080614]
>
> Sorry I can't follow what you are attempting to do. Tou aren't showing
> us the actual data (with namespaces) or actual rules (with all these
> variables expanded) so it's hard to spot the details. Also unclear what
> you mean by "output", whether you are looking at a dump of the whole
> model, just the deductions graph or something else.
>
> How you do you know the first rule isn't firing? Since it makes no
> change to the data it's going to be hard to tell. Use the print builtin
> to help debug.
>
> If you can't work it out then generate a minimal complete test case with
> just minimal test data (ideally in turtle with all prefixes defined) and
> minimal rule example (actual rule, not source code snippet that
> generates the rule) then post that. Then maybe someone can spot what's
> happening.
>
> Dave
>
> > El lun., 16 mar. 2020 a las 9:13, Dave Reynolds (<
> dave.e.reyno...@gmail.com>)
> > escribió:
> >
> >>
> >> On 16/03/2020 06:58, Luis Enrique Ramos García wrote:
> >>> Dear friends,
> >>>
> >>> I am running a rule in a data set, which has the following format:
> >>>
> >>> http://www.example.com/onto/gleif1.owl#097900BHID080614";>
> >>>>>>
> >>
> xml:lang="ia">ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID080614]
> >>>   scope s.r.o.
> >>>
> >>>
> >>
> search_ID
> >>>
> >> RA000526
> >>>   scope s.r.o.
> >>> *
> >>>
> >>
> ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[09

Re: unexpected output in rule

2020-03-16 Thread Luis Enrique Ramos García
Hi Dave,

thanks for your quick response,

I though that was the cause of the problem, however when I add the bind to
?ord in the body, then the rule is not triggered , I changed  as in rule 1:


String rule 1=  (?b rdf_ns:type  GLEIF1_NS Entity)  (?b GLEIF1_NS has_ord
?ord) (?b GLEIF1_NS registration_Authority_entity_ID "search_ID') -> (?b
GLEIF1_NS has_ord ?ord)

String rule 2=  (?b rdf_ns:type  GLEIF1_NS Entity)  (?b GLEIF1_NS
registration_Authority_entity_ID "search_ID') -> (?b GLEIF1_NS has_ord ?ord)


as shown above the rule 1 does not trigger, rule 2 does trigger as
expected, but the output value does not corresponds to the value of ?ord. I
obtained this value > *ae791d81-7538-49ac-9436-898ede09d7b5*], and should
have been > ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID080614]


Luis




El lun., 16 mar. 2020 a las 9:13, Dave Reynolds ()
escribió:

>
> On 16/03/2020 06:58, Luis Enrique Ramos García wrote:
> > Dear friends,
> >
> > I am running a rule in a data set, which has the following format:
> >
> >http://www.example.com/onto/gleif1.owl#097900BHID080614";>
> >   >
> xml:lang="ia">ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID080614]
> >  scope s.r.o.
> >
> >
> search_ID
> >
> RA000526
> >  scope s.r.o.
> > *
> >
> ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID080614]*
> >  1
> >
> >
> > where I want to obtain the *has_ord* property value with the rule:
> >
> >   String rule_rid= "[rule1: (?b "+rdf_ns+"type "+GLEIF1_NS+"Entity) "
> > + "(?b "+GLEIF1_NS+"registration_Authority_entity_ID
> > "+"'"+search_ID+"')"//get all gleif entities ID
> > + "-> (?b "+GLEIF1_NS+"has_ord ?ord)]";//put the output
>
> That's very hard to read but unless I'm missing something there's
> nothing in the body of the rule to bind ?ord.
>
> Dave
>
> >
> > The rule is triggered as expected, however the value in the output does
> not
> > corresponds to the real value:
> >
> > output:
> >
> > http://www.example.com/onto/gleif1.owl#has_ord,
> > *ae791d81-7538-49ac-9436-898ede09d7b5*]
> >
> > but, it should be:
> >
> > http://www.example.com/onto/gleif1.owl#has_ord,*
> > ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID080614]
> > ]*
> >
> >
> > I am running the jena rule against a model stored in a tdb database.
> >
> > Thanks in advanced for your support.
> >
> >
> > Luis Ramos
> >
>


unexpected output in rule

2020-03-15 Thread Luis Enrique Ramos García
Dear friends,

I am running a rule in a data set, which has the following format:

  http://www.example.com/onto/gleif1.owl#097900BHID080614";>
ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID080614]
scope s.r.o.

search_ID
RA000526
scope s.r.o.
*
ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID080614]*
1


where I want to obtain the *has_ord* property value with the rule:

 String rule_rid= "[rule1: (?b "+rdf_ns+"type "+GLEIF1_NS+"Entity) "
+ "(?b "+GLEIF1_NS+"registration_Authority_entity_ID
"+"'"+search_ID+"')"//get all gleif entities ID
+ "-> (?b "+GLEIF1_NS+"has_ord ?ord)]";//put the output

The rule is triggered as expected, however the value in the output does not
corresponds to the real value:

output:

http://www.example.com/onto/gleif1.owl#has_ord,
*ae791d81-7538-49ac-9436-898ede09d7b5*]

but, it should be:

http://www.example.com/onto/gleif1.owl#has_ord,*
ord:urn:iso:std:iso:17442:2019:ed-1:v2:en:[097900BHID080614]
]*


I am running the jena rule against a model stored in a tdb database.

Thanks in advanced for your support.


Luis Ramos


Re: Java heap space

2020-02-27 Thread Luis Enrique Ramos García
Dear Claude,

sorry to not answer on time, I am working in another part of the project
now, but I will take in consideration your recommendation, and will let you
know my results.


Luis

El dom., 16 feb. 2020 a las 12:42, Claude Warren ()
escribió:

> Luis,
>
> Did you solve this problem?  Did you try setting the -Xmx property on the
> Java command line?  I don't recall what the default is but you could set it
> to something like -Xmx:1g to allocate 1 gig of memory.
>
> Claude
>
>
> On Wed, Feb 5, 2020 at 12:24 PM Luis Enrique Ramos García
>  wrote:
>
> > >
> > > Dear members of jena community
> > >
> >
> > I am working with two ontologies, merged in a model, the size of the
> > ontologies is as follows:
> >
> > *ontology1* 2,7 Mbytes, 25K axioms and 6000 individuals
> >
> > *ontology2* 8,1 Mbytes, 72 K axioms, and 9000 items,
> >
> > I implemented a rule that checks if an item of o1 has the same label of
> an
> > item of o2, with a generic rule reasoner of jena
> >
> > when I use less items in ontology 2,  3000 and 6000 i get the result in
> 7,2
> > and 21, sec, but with 9000 items, I get the following error:
> >
> > Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
> > at
> >
> >
> org.apache.jena.reasoner.rulesys.impl.BindingVectorMultiSet.getSubSet(BindingVectorMultiSet.java:144)
> > at
> org.apache.jena.reasoner.rulesys.impl.RETEQueue.fire(RETEQueue.java:114)
> > at
> org.apache.jena.reasoner.rulesys.impl.RETEQueue.fire(RETEQueue.java:128)
> > at
> org.apache.jena.reasoner.rulesys.impl.RETEQueue.fire(RETEQueue.java:128)
> > at
> >
> >
> org.apache.jena.reasoner.rulesys.impl.RETEClauseFilter.fire(RETEClauseFilter.java:227)
> > at
> >
> >
> org.apache.jena.reasoner.rulesys.impl.RETEEngine.inject(RETEEngine.java:492)
> > at
> >
> >
> org.apache.jena.reasoner.rulesys.impl.RETEEngine.runAll(RETEEngine.java:474)
> > at
> >
> >
> org.apache.jena.reasoner.rulesys.impl.RETEEngine.fastInit(RETEEngine.java:163)
> > at
> >
> >
> org.apache.jena.reasoner.rulesys.FBRuleInfGraph.prepare(FBRuleInfGraph.java:471)
> > at
> >
> >
> org.apache.jena.reasoner.rulesys.BasicForwardRuleInfGraph.getDeductionsGraph(BasicForwardRuleInfGraph.java:392)
> > at
> >
> >
> org.apache.jena.rdf.model.impl.InfModelImpl.getDeductionsModel(InfModelImpl.java:169)
> >
> >
> > My question is if there is a way to solve this memory issue in jena
> side?,
> > given that the available memory of my computer is 1,2 gb, and I think
> that
> > should not be the cause, however I could be wrong.
> >
> > Any support is thanked
> >
> >
> > Luis Ramos
> >
>
>
> --
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren
>


Re: fuseki server in windows and ubuntu

2020-02-10 Thread Luis Enrique Ramos García
Thanks for your support, just running,

about your question, I saw different options to run the server here:

https://jena.apache.org/documentation/fuseki2/fuseki-run.html


my interest is run the service, load data as use it as a query service for
my application, and I understood i was running it as a stand alone
server, "This
is running Fuseki from the command line.".


Please, let me know if I could be doing something wrong, or if I could be
following a inconvenient method.



Best regards



Luis Ramos

El mar., 11 feb. 2020 a las 8:48, Lorenz Buehmann (<
buehm...@informatik.uni-leipzig.de>) escribió:

> We had some trouble with the executable bit in the last release
>
> please go to your Fuseki directory and do
>
> chmod +x fuseki-server
>
>
> I'm also not sure why you want to run Fuseki as root?
>
> On 11.02.20 08:32, Luis Enrique Ramos García wrote:
> > Dear member of jena community,
> >
> > I am beginning to work with fuseki server, and for windows installation
> > (home laptop) I followed this instructions, and got the server running in
> > some minutes:
> >
> > https://www.youtube.com/watch?v=3WTtKaIfqnk
> >
> >
> > However, when I tried to do it in ubuntu (work laptop), following this
> > instructions:
> >
> > https://github.com/ont-app/fuseki-starter, using the most recent
> version of
> > fuseki, and setting up environment variables fuseki-base, I am not able
> to
> > run the server, and I receive the following error message.
> >
> > *sudo: ./fuseki-server: command not found*
> >
> > I wonder what could happens here?,
> >
> >
> > Best regards
> >
> >
> > Luis Ramos
> >
>


fuseki server in windows and ubuntu

2020-02-10 Thread Luis Enrique Ramos García
Dear member of jena community,

I am beginning to work with fuseki server, and for windows installation
(home laptop) I followed this instructions, and got the server running in
some minutes:

https://www.youtube.com/watch?v=3WTtKaIfqnk


However, when I tried to do it in ubuntu (work laptop), following this
instructions:

https://github.com/ont-app/fuseki-starter, using the most recent version of
fuseki, and setting up environment variables fuseki-base, I am not able to
run the server, and I receive the following error message.

*sudo: ./fuseki-server: command not found*

I wonder what could happens here?,


Best regards


Luis Ramos


Java heap space

2020-02-05 Thread Luis Enrique Ramos García
>
> Dear members of jena community
>

I am working with two ontologies, merged in a model, the size of the
ontologies is as follows:

*ontology1* 2,7 Mbytes, 25K axioms and 6000 individuals

*ontology2* 8,1 Mbytes, 72 K axioms, and 9000 items,

I implemented a rule that checks if an item of o1 has the same label of an
item of o2, with a generic rule reasoner of jena

when I use less items in ontology 2,  3000 and 6000 i get the result in 7,2
and 21, sec, but with 9000 items, I get the following error:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at
org.apache.jena.reasoner.rulesys.impl.BindingVectorMultiSet.getSubSet(BindingVectorMultiSet.java:144)
at org.apache.jena.reasoner.rulesys.impl.RETEQueue.fire(RETEQueue.java:114)
at org.apache.jena.reasoner.rulesys.impl.RETEQueue.fire(RETEQueue.java:128)
at org.apache.jena.reasoner.rulesys.impl.RETEQueue.fire(RETEQueue.java:128)
at
org.apache.jena.reasoner.rulesys.impl.RETEClauseFilter.fire(RETEClauseFilter.java:227)
at
org.apache.jena.reasoner.rulesys.impl.RETEEngine.inject(RETEEngine.java:492)
at
org.apache.jena.reasoner.rulesys.impl.RETEEngine.runAll(RETEEngine.java:474)
at
org.apache.jena.reasoner.rulesys.impl.RETEEngine.fastInit(RETEEngine.java:163)
at
org.apache.jena.reasoner.rulesys.FBRuleInfGraph.prepare(FBRuleInfGraph.java:471)
at
org.apache.jena.reasoner.rulesys.BasicForwardRuleInfGraph.getDeductionsGraph(BasicForwardRuleInfGraph.java:392)
at
org.apache.jena.rdf.model.impl.InfModelImpl.getDeductionsModel(InfModelImpl.java:169)


My question is if there is a way to solve this memory issue in jena side?,
given that the available memory of my computer is 1,2 gb, and I think that
should not be the cause, however I could be wrong.

Any support is thanked


Luis Ramos


Re: substractDate built in

2020-01-22 Thread Luis Enrique Ramos García
Hi Lorenz,

I will follow it then, and try to get it working.

by the way, in the documentation refereed to lessThan, and greaterThan says
the following:

Test if x is <, >, <= or >= y. Only passes if both x and y are numbers or
time instants (can be integer or floating point or *XSDDateTime*).

Thus, for me it is clear than these builtins must evaluate  to true or
false in case of dates, as you say. I will implement this first, and
comment the results.


Best regards


Luis Ramos

El mié., 22 ene. 2020 a las 9:03, Lorenz Buehmann (<
buehm...@informatik.uni-leipzig.de>) escribió:

> Well, this blog post is about creating a custom rule primitive, and this
> is also what you'd have to do if you need some custom function that is
> not already among the Jena built-ins. So if you really need such  a
> subtractDates function, why not following the blog and create and
> register your own rule primitive?
>
> On 22.01.20 08:25, Luis Enrique Ramos García wrote:
> > Dear friends,
> > barry, here is the reference:
> >
> >
> https://henrietteharmse.com/2018/04/21/creating-custom-rule-primitives-for-jena/
> >
> > But, after searching more carefully, I found it is another tool using
> jena,
> > but not jena at all.
> >
> > So, I wanted to confirm that such builtin was available.
> >
> > By the way, you say if I use dates with lessThan and greaterThan they
> > should resolve to true or false?, an specific date format for that?
> >
> >
> > Luis Ramos
> >
> > El mar., 21 ene. 2020 a las 15:14, Nouwt, B. (Barry)
> > () escribió:
> >
> >> Hi Luis Ramos, where can we find this substractDates builtin? I cannot
> >> find it in the source code:
> >>
> >>
> >>
> https://github.com/apache/jena/tree/master/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/builtins
> >>
> >> or the documentation:
> >>
> >> https://jena.apache.org/documentation/inference/#builtin-primitives
> >>
> >> There are lessThan, greaterThan builtins that evaluate to true if one
> data
> >> is more recent than another.
> >>
> >> Regards, Barry
> >>
> >> -Original Message-
> >> From: Luis Enrique Ramos García
> >> 
> >> Sent: dinsdag 21 januari 2020 10:56
> >> To: users@jena.apache.org
> >> Subject: substractDate built in
> >>
> >> Dear friends,
> >>
> >> I a trying to perform some operations with dates using rules in jena.
> One
> >> of those is calculating ages. I found the built in subtractDates(x1, x2,
> >> x3), and at first I wonder if this is a valid jena built in?, at
> second, I
> >> implemented it with the rule 1 however it does not trigger as expected,
> >> thus I wonder if the built in is properly implemented?. The date format
> I
> >> am using is -MM-dd.
> >>
> >> @prefix ex: <http://www.example.com#>.
> >>
> >> [*rule1:* (?a  ex:birthday ?d1) (?b  ex:currentdate ?d2)
> subtractDates(?d1,
> >> ?d2 ,?age)   -> (?a ex:currentage ?age )]
> >>
> >> Where, d1 and d2 are xsd date time values, and age is decimal.
> >>
> >> I also implemented the greater than with integer numbers, and I got the
> >> expected result, but I would like to know if there is a built in for
> date,
> >> where I could evaluate to true when a date is more recent than another?.
> >>
> >>
> >> Best regards
> >>
> >>
> >> Luis Ramos
> >> This message may contain information that is not intended for you. If
> you
> >> are not the addressee or if this message was sent to you by mistake, you
> >> are requested to inform the sender and delete the message. TNO accepts
> no
> >> liability for the content of this e-mail, for the manner in which you
> use
> >> it and for damage of any kind resulting from the risks inherent to the
> >> electronic transmission of messages.
> >>
>


Re: substractDate built in

2020-01-21 Thread Luis Enrique Ramos García
Dear friends,
barry, here is the reference:

https://henrietteharmse.com/2018/04/21/creating-custom-rule-primitives-for-jena/

But, after searching more carefully, I found it is another tool using jena,
but not jena at all.

So, I wanted to confirm that such builtin was available.

By the way, you say if I use dates with lessThan and greaterThan they
should resolve to true or false?, an specific date format for that?


Luis Ramos

El mar., 21 ene. 2020 a las 15:14, Nouwt, B. (Barry)
() escribió:

> Hi Luis Ramos, where can we find this substractDates builtin? I cannot
> find it in the source code:
>
>
> https://github.com/apache/jena/tree/master/jena-core/src/main/java/org/apache/jena/reasoner/rulesys/builtins
>
> or the documentation:
>
> https://jena.apache.org/documentation/inference/#builtin-primitives
>
> There are lessThan, greaterThan builtins that evaluate to true if one data
> is more recent than another.
>
> Regards, Barry
>
> -Original Message-
> From: Luis Enrique Ramos García
> 
> Sent: dinsdag 21 januari 2020 10:56
> To: users@jena.apache.org
> Subject: substractDate built in
>
> Dear friends,
>
> I a trying to perform some operations with dates using rules in jena. One
> of those is calculating ages. I found the built in subtractDates(x1, x2,
> x3), and at first I wonder if this is a valid jena built in?, at second, I
> implemented it with the rule 1 however it does not trigger as expected,
> thus I wonder if the built in is properly implemented?. The date format I
> am using is -MM-dd.
>
> @prefix ex: <http://www.example.com#>.
>
> [*rule1:* (?a  ex:birthday ?d1) (?b  ex:currentdate ?d2) subtractDates(?d1,
> ?d2 ,?age)   -> (?a ex:currentage ?age )]
>
> Where, d1 and d2 are xsd date time values, and age is decimal.
>
> I also implemented the greater than with integer numbers, and I got the
> expected result, but I would like to know if there is a built in for date,
> where I could evaluate to true when a date is more recent than another?.
>
>
> Best regards
>
>
> Luis Ramos
> This message may contain information that is not intended for you. If you
> are not the addressee or if this message was sent to you by mistake, you
> are requested to inform the sender and delete the message. TNO accepts no
> liability for the content of this e-mail, for the manner in which you use
> it and for damage of any kind resulting from the risks inherent to the
> electronic transmission of messages.
>


Re: unexpected output when running rule

2020-01-21 Thread Luis Enrique Ramos García
Dear Dave,

Thanks for the time invested, I think I understood what you meant, if I
understood correctly I created indirectly an *anonymous class *with all
members of c0 and c1,
and when I run a rule to say that all members of c0 are members of c2, then
member of c1 also became members of c2.

I wanted to have the configuration indicated for you at the end of your
exposition, however I think I would require more work to control this
behavior, then I will try to work with the first option you mentioned.


Bets

Luis Ramos




El lun., 20 ene. 2020 a las 22:35, Dave Reynolds ()
escribió:

> In your example code you have an OntModel which is specified to include
> a reasoner using the default OWL rules. You then have an InfModel on top
> of that with your own rule. So the OWL rules are generating entailments
> from the domain declarations for born_in which are then visible through
> your enclosing rule InfModel.
>
> I'm not sure exactly want you want to achieve ...
>
> If you want an OntModel interface but with just your rule(s) then one
> easy way is to generate your own OntModelSpec based off OWL_MEM and
> attach your reasoner to it using setReasoner, then use that to create
> your OntModel. Don't bother with a separate InfModel. That way you just
> have one layer of model and avoid any confusion from nesting models.
>
> If you just want a plaing InfModel interface with just your rules then
> you can create the InfModel as you are doing over either a plain Model
> or over an OntModel with no second reasoning layer.
>
> If you want OWL inference and then want to run your own rules on top of
> that then the setup you have is one way to do that.
>
> Comments inline below ...
>
> On 20/01/2020 10:06, Luis Enrique Ramos García wrote:
> >> Dear friends of jena community,
> >
> >
> > I am testing the syntax of apache jena rules, with a very simple example,
> > where I create the following model and  classes:
> >
> >
> >OntModel m = ModelFactory.createOntologyModel();
> >
> > OntClass c0 = m.createClass( NS + "c0" );
> > OntClass c1 = m.createClass( NS + "c1" );
> > OntClass c2 = m.createClass( NS + "c2" );
> >
> > and the following individuals as members of the its respective classes:
> >
> > //creation of individual
> >
> > Individual i0 = m.createIndividual( NS + "individual0", c0 );
> > Individual i1 = m.createIndividual( NS + "individual1", c1 );
> >
> >   when I run the rule, that says:
> >
> > if individual* i? *is member of c0, then has to be member of *c2*
> >
> > String *ruleSrc* = "[rule1: (?a
> > http://www.w3.org/1999/02/22-rdf-syntax-ns#type www.example.com#c0) -> "
> > + "(?a http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> www.example.com#c2)
> > ]";
>
> More readable if you use the builtin prefixes like rdf:type
>
> Also www.example.com# is a (scheme-) relative URL, not that it matters
> in this case but better to get used to using absolute URLs including the
> http:// bit.
>
> >
> > the rule is triggered as expected and give me the following result:
> >
> >   [www.example.com#individual0,
> > http://www.w3.org/1999/02/22-rdf-syntax-ns#type, www.example.com#c2]>
> >
> > Nevertheless, when I add more information to the model, and say that
> > individuals i0 and i1 have birthday:
> >
> > i0.addProperty(born_in, date1.toString());
> > i1.addProperty(born_in, date2.toString());
> >
> > The behavior of rule output changed, and I obtain a different result:
> >  > www.example.com#individual1,
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type,
> > www.example.com#c2] [www.example.com#individual0,
> > http://www.w3.org/1999/02/22-rdf-syntax-ns#type, www.example.com#c2]>
>
> > Where individual 1 is declared as member of c2, it means that individual1
> > is member of c0, something that I did not declared.
>
> You did but indirectly. You declared that the domain of born_in includes
> c0 and c1. So the with-OWL-inference OntModel will deduce, among other
> things:
>
> :i0 rdf:type  :c0
>
> Then your own rule, runing in the InfModel, sees that and since it
> states that anything of type c0 is also of type c2 it deduces that:
>
> :i0 rdf:type  :c2
>
> >
> > I changed model declaration as follows:
> >
> >OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
> >
> > and obtained the expected result, however the documentation says there is
> > not reasoning there,
>
> Correct. That way the OntModel itself is not doing any reasoning, s

substractDate built in

2020-01-21 Thread Luis Enrique Ramos García
Dear friends,

I a trying to perform some operations with dates using rules in jena. One
of those is calculating ages. I found the built in subtractDates(x1, x2,
x3), and at first I wonder if this is a valid jena built in?, at second, I
implemented it with the rule 1 however it does not trigger as expected,
thus I wonder if the built in is properly implemented?. The date format I
am using is -MM-dd.

@prefix ex: .

[*rule1:* (?a  ex:birthday ?d1) (?b  ex:currentdate ?d2) subtractDates(?d1,
?d2 ,?age)   -> (?a ex:currentage ?age )]

Where, d1 and d2 are xsd date time values, and age is decimal.

I also implemented the greater than with integer numbers, and I got the
expected result, but I would like to know if there is a built in for date,
where I could evaluate to true when a date is more recent than another?.


Best regards


Luis Ramos


unexpected output when running rule

2020-01-20 Thread Luis Enrique Ramos García
> Dear friends of jena community,


I am testing the syntax of apache jena rules, with a very simple example,
where I create the following model and  classes:


  OntModel m = ModelFactory.createOntologyModel();

OntClass c0 = m.createClass( NS + "c0" );
OntClass c1 = m.createClass( NS + "c1" );
OntClass c2 = m.createClass( NS + "c2" );

and the following individuals as members of the its respective classes:

//creation of individual

Individual i0 = m.createIndividual( NS + "individual0", c0 );
Individual i1 = m.createIndividual( NS + "individual1", c1 );

 when I run the rule, that says:

if individual* i? *is member of c0, then has to be member of *c2*

String *ruleSrc* = "[rule1: (?a
http://www.w3.org/1999/02/22-rdf-syntax-ns#type www.example.com#c0) -> "
+ "(?a http://www.w3.org/1999/02/22-rdf-syntax-ns#type www.example.com#c2)
]";

the rule is triggered as expected and give me the following result:

 [www.example.com#individual0,
http://www.w3.org/1999/02/22-rdf-syntax-ns#type, www.example.com#c2]>

Nevertheless, when I add more information to the model, and say that
individuals i0 and i1 have birthday:

i0.addProperty(born_in, date1.toString());
i1.addProperty(born_in, date2.toString());

The behavior of rule output changed, and I obtain a different result:
http://www.w3.org/1999/02/22-rdf-syntax-ns#type,
www.example.com#c2] [www.example.com#individual0,
http://www.w3.org/1999/02/22-rdf-syntax-ns#type, www.example.com#c2]>

Where individual 1 is declared as member of c2, it means that individual1
is member of c0, something that I did not declared.

I changed model declaration as follows:

  OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);

and obtained the expected result, however the documentation says there is
not reasoning there, thus I implemented a reasoner model and obtained an
unexpected result again.

My main concern is that when I inspect the *asserted model , *I see it
contains individual 1 declared as part of c0, something that, according to
my understanding should not occur, because I have not declared that.

Any comment and recommendation is welcomed.

Bellow is the whole java code.


Luis Ramos


CODE
**

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.apache.jena.ontology.DatatypeProperty;
import org.apache.jena.ontology.Individual;
import org.apache.jena.ontology.OntClass;
import org.apache.jena.ontology.OntModel;
import org.apache.jena.ontology.OntModelSpec;
import org.apache.jena.rdf.model.InfModel;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.reasoner.Reasoner;
import org.apache.jena.reasoner.rulesys.GenericRuleReasoner;
import org.apache.jena.reasoner.rulesys.Rule;
import org.apache.jena.vocabulary.XSD;

public class OntGenRule {

public static void main(String[] args) throws ParseException {

String URL = "www.example.com";
String NS = URL+"#";
String rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns";;


String rdf_ns = rdf+"#";

//creation of the model

OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);

//addition of classes

OntClass c0 = m.createClass( NS + "c0" );
OntClass c1 = m.createClass( NS + "c1" );
OntClass c2 = m.createClass( NS + "c2" );

//creation of individual

Individual i0 = m.createIndividual( NS + "individual0", c0 );

Individual i1 = m.createIndividual( NS + "individual1", c1 );



//date property

DatatypeProperty born_in = m.createDatatypeProperty( NS + "birthday" );
born_in.addDomain( m.getOntClass( NS + "c0" ) );
born_in.addDomain( m.getOntClass( NS + "c1" ) );

born_in.addRange( XSD.dateTime );

//create a date

SimpleDateFormat sdf = new SimpleDateFormat("dd-M-
hh:mm:ss");//-uncomment for test
String date1toString = "31-08-1982 10:20:56";//-uncomment for test
String date2toString = "12-02-1977 10:20:56";//-uncomment for test


Date date1 = sdf.parse(date1toString);//-uncomment for test

Date date2 = sdf.parse(date2toString);//-uncomment for test

//addition of date to individuals

i0.addProperty(born_in, date1.toString());//-uncomment for test

i1.addProperty(born_in, date2.toString());//-uncomment for test


//System.out.println(p0.getProperty(born_in).getObject());

//System.out.println(p1.getProperty(born_in).getObject());

OntModel testModel =
ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM_RULE_INF,
m);//onto model, to hold ontology


String ruleSrc = "[rule1: (?a
http://www.w3.org/1999/02/22-rdf-syntax-ns#type www.example.com#c0) -> "
+ "(?a http://www.w3.org/1999/02/22-rdf-syntax-ns#type www.example.com#c2)
]";

List rules = Rule.parseRules(ruleSrc);

Reasoner reasoner = new GenericRuleReasoner(rules);

InfModel inf = ModelFactory.createInfModel(reasoner, testModel);

Model deducedM = ModelFactory.createOntologyModel();

deducedM = inf.getDeductionsModel();

System.out.p

Re: reasoner performance

2020-01-08 Thread Luis Enrique Ramos García
Dear friends,

given that my larger experience is with OWL; swrl, and swqrl, that was my
first option, my challenge is to get the job done, the approach to follow
now is not the most important, so I am going to write the queries in
sparql, and execute them in my workflow, if I find any constrain in my
process I will keep you inform.

best regards


Luis Ramos

El mié., 8 ene. 2020 a las 22:01, ajs6f () escribió:

> At a high level, it seems just as easy (if not a good bit easier) to do
> this in SPARQL (which can be understood as supporting some simple
> inferencing, if you like to think of it that way). Is it absolutely
> necessary to do this using inferencing? Are you trying to use that because
> your recent experience has been with OWL?
>
> ajs6f
>
> > On Jan 8, 2020, at 5:14 AM, Luis Enrique Ramos García
>  wrote:
> >
> > Dear friends,
> >
> > Thanks so much for your quick answer,
> >
> > At first about our use case, I estimate that we will be working with
> around
> > 100 millions triples at the beginning, thus according to the answer of
> > Dave, this size should be manageable by Jena, or I am wrong?, of course
> > surely we will grow quickly, and then I think we should have our eyes
> > targeted in another stores, as you recommend. I think that this benchmark
> > could be a good starting point [1].
> >
> > Second, about the reasoning, our task is as follows:
> >
> > let us say we have a knowledgebase of people (p1, p2, pn) and friendships
> > (f1, f2, fn). Where p1, p2, pn and f1, f2, fn are individuals of the
> > respective concepts (people and friendship). People are related by
> > friendships, every friendship occurs between two different people, has
> > start date, and end date of the friendship, if any, and a validity, this
> > validity is a Boolean. In our reasoning we want to get friendly people,
> and
> > for us a friendly person would have more than "X" valid friendships.
> >
> > For this, I think i have to follow the following workflow:
> >
> > 1. Run a rule to evaluate the friendship validity, triggering it to true
> or
> > false.
> >
> > 2. Perform inference on the result to get valid friendship, if any.
> >
> >
> > About my third question:
> >
> > 3. is necessary a triple store to use with reasoner and rule engine?, in
> >> that case what do you recommend?
> >
> > my most experience has been with protege, and owl api, and I understood
> > that they recommended a back end repository for dealing with large
> > datasets, perhaps I misunderstood it, and I know that stores and
> reasoners
> > are different things.
> >
> > Well, I thank you in advance all the recommendations you could give me.
> >
> > best regards
> >
> >
> > Luis Ramos
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > [1] https://www.w3.org/wiki/LargeTripleStores
> >
> >
> > El mar., 7 ene. 2020 a las 11:01, Lorenz Buehmann (<
> > buehm...@informatik.uni-leipzig.de>) escribió:
> >
> >> I agree with Dave, we should start with the most important things:
> >>
> >> i) what is the use case
> >> ii) what kind of inference is needed here
> >>
> >> There is an obvious difference between a full OWL 2 compliant DL
> >> reasoner usually using tableau algorithm and a reasoner based on rules.
> >>
> >> Most common benchmarks I touched have been LUBM and UOBM to evaluated
> >> performance of large scale reasoner usually to some extended related to
> >> triple stores (or even integrated)
> >>
> >> I'd not go with the map-reduce way, there are already approaches based
> >> on Spark and Flink for some (sub)set of OWL/RDFS inference rules. Those
> >> tend to be faster due to benefits like in-memory processing especially
> >> when iterative algorithms like fix-point etc. come into play.
> >>
> >> Anyways, we should start with i) and ii) here.
> >>
> >> On 07.01.20 09:59, Dave Reynolds wrote:
> >>> On 07/01/2020 08:31, Luis Enrique Ramos García wrote:
> >>>> Dear friends,
> >>>>
> >>>> I am currently working in an application in where I have to implement
> a
> >>>> reasoner, in which I have had some experience, the difference is that
> >>>> this
> >>>> time i have to implement it in a big data env

Re: reasoner performance

2020-01-08 Thread Luis Enrique Ramos García
Dear friends,

Thanks so much for your quick answer,

At first about our use case, I estimate that we will be working with around
100 millions triples at the beginning, thus according to the answer of
Dave, this size should be manageable by Jena, or I am wrong?, of course
surely we will grow quickly, and then I think we should have our eyes
targeted in another stores, as you recommend. I think that this benchmark
could be a good starting point [1].

Second, about the reasoning, our task is as follows:

let us say we have a knowledgebase of people (p1, p2, pn) and friendships
(f1, f2, fn). Where p1, p2, pn and f1, f2, fn are individuals of the
respective concepts (people and friendship). People are related by
friendships, every friendship occurs between two different people, has
start date, and end date of the friendship, if any, and a validity, this
validity is a Boolean. In our reasoning we want to get friendly people, and
for us a friendly person would have more than "X" valid friendships.

For this, I think i have to follow the following workflow:

1. Run a rule to evaluate the friendship validity, triggering it to true or
false.

2. Perform inference on the result to get valid friendship, if any.


 About my third question:

 3. is necessary a triple store to use with reasoner and rule engine?, in
> that case what do you recommend?

my most experience has been with protege, and owl api, and I understood
that they recommended a back end repository for dealing with large
datasets, perhaps I misunderstood it, and I know that stores and reasoners
are different things.

Well, I thank you in advance all the recommendations you could give me.

best regards


Luis Ramos
























[1] https://www.w3.org/wiki/LargeTripleStores


El mar., 7 ene. 2020 a las 11:01, Lorenz Buehmann (<
buehm...@informatik.uni-leipzig.de>) escribió:

> I agree with Dave, we should start with the most important things:
>
> i) what is the use case
> ii) what kind of inference is needed here
>
> There is an obvious difference between a full OWL 2 compliant DL
> reasoner usually using tableau algorithm and a reasoner based on rules.
>
> Most common benchmarks I touched have been LUBM and UOBM to evaluated
> performance of large scale reasoner usually to some extended related to
> triple stores (or even integrated)
>
> I'd not go with the map-reduce way, there are already approaches based
> on Spark and Flink for some (sub)set of OWL/RDFS inference rules. Those
> tend to be faster due to benefits like in-memory processing especially
> when iterative algorithms like fix-point etc. come into play.
>
> Anyways, we should start with i) and ii) here.
>
> On 07.01.20 09:59, Dave Reynolds wrote:
> > On 07/01/2020 08:31, Luis Enrique Ramos García wrote:
> >> Dear friends,
> >>
> >> I am currently working in an application in where I have to implement a
> >> reasoner, in which I have had some experience, the difference is that
> >> this
> >> time i have to implement it in a big data environment, where I have
> >> to deal
> >> with a data set od some giga bytes.
> >>
> >> About that, my questions are the following:
> >>
> >> 1. is there a benchmark or evaluation of performance of jena with some
> >> reasoners, which consider memory or quantity of triples, and
> >> execution time?.
> >
> > Depends what sort of inference you are talking about.
> >
> > Apart from the OWL benchmarks you mention, some of the Sparql
> > benchmarks do require small amounts of reasoning loosely around
> > RDFS++. For example, I seem to remember LUBM requires this but I've
> > never worked with it.
> >
> > Jena's inference is not designed to scale to billons of triples, it's
> > a memory-only solution (though "giga byes" might mean just millions of
> > triples and might fit in memory). So reasoning at scale benchmarks on
> > Jena are not going to be much use to you. Look at the results for
> > commercial stores that do claim inference at scale.
> >
> >> 2. is elephas, and a map reduce approach a good alternative to deal
> >> with a
> >> big data environment?
> >
> > Depends what sort of inference you are talking about and whether you
> > care about latency or just overall throughput at scale. Map reduce is
> > not good for low latency interactive queries.
> >
> >> 3. is necessary a triple store to use with reasoner and rule engine?, in
> >> that case what do you recommend?
> >
> > Don't understand the question. Triple stores and reasoners are
> > different things. You can have reasoners that have nothing to do with
> > RDF/triple-stores and you can have triple stores with no reasoner.
> > There are fair number of commercial and open source tools in both
> > categories and in the overlap.
> >
> > Dave
>
>


reasoner performance

2020-01-07 Thread Luis Enrique Ramos García
Dear friends,

I am currently working in an application in where I have to implement a
reasoner, in which I have had some experience, the difference is that this
time i have to implement it in a big data environment, where I have to deal
with a data set od some giga bytes.

About that, my questions are the following:

1. is there a benchmark or evaluation of performance of jena with some
reasoners, which consider memory or quantity of triples, and
execution time?.

2. is elephas, and a map reduce approach a good alternative to deal with a
big data environment?

3. is necessary a triple store to use with reasoner and rule engine?, in
that case what do you recommend?

About the first question, I have found performance evaluation, but mostly
for OWL reasoners, about the second question, I have evaluated the use of
elephas, but i would like to know the opinion of users who has had this
experience, and about the third i have not worked with such triple stores.

Best regards

Luis Ramos


Re: issue installing jena 3 in windows 8

2019-07-18 Thread Luis Enrique Ramos García
Hi Lorenz,

sorry because of my late reply, I was in an international travel.

I am using Jena with java and maven by eclipse,


The issue is just solved,


Thanks


Luis Ramos

El lun., 15 jul. 2019 a las 3:21, Lorenz B. (<
buehm...@informatik.uni-leipzig.de>) escribió:

> Hello,
>
> just as a general comment, Jena artifacts are published in the official
> Maven repo. No need to build from source or download them manually if
> your project uses Maven, Ivy or SBT.
>
> Can you please explain how you want to use Jena?
> - From Java? If so, is it a Maven project?
> - From CLI? If so, there are downloadable releases which contains all
> the tools and scripts.
>
>
>
> More comments inline:
>
> >
> >
> > I am trying to install jena 3.12.0 in windows 8 to use it with eclipse.
> which Java version?
> >
> > I followed instructions of this web page:
> >
> > https://jena.apache.org/getting_involved/index.html
> what does this mean?
> >
> > at first the repository indicated there seems to be invalid, then I
> > used the following repository:
> >
> > https://github.com/apache/jena.git
> >
> > and followed the procedure from command prompt:
> >
> > git clone  https://github.com/apache/jena.git
> >
> > cd jena
> > mvn clean install
> > nevertheless, after running for several minutes there was a failure.
> >
> > I attached the screenshot.
> attachments are not allowed on this mailing list. Please provide a link
> to the uploaded screenshot.
> >
> > Then, I wonder what could happens here?, the result is similar if I
> > download the binaries and try to compile and install.
>
> Why do you download binaries and then want to compile them? Binaries are
> already compiled. And install what or how?
>
>
>
>
>
>
> >
> > Any recommendation would be appreciated.
> >
> >
> > best regards
> >
> >
> > Luis Ramos
> >
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


issue installing jena 3 in windows 8

2019-07-14 Thread Luis Enrique Ramos García
Dear friends,

I am trying to install jena 3.12.0 in windows 8 to use it with eclipse.

I followed instructions of this web page:

https://jena.apache.org/getting_involved/index.html

at first the repository indicated there seems to be invalid, then I used
the following repository:

https://github.com/apache/jena.git

and followed the procedure from command prompt:

git clone  https://github.com/apache/jena.git

cd jenamvn clean install

nevertheless, after running for several minutes there was a failure.

I attached the screenshot.

Then, I wonder what could happens here?, the result is similar if I
download the binaries and try to compile and install.

Any recommendation would be appreciated.


best regards


Luis Ramos