Dear Joylix,

It’s great that you’re using RDFLib but this email list is for technical 
matters relating to the RDFLib software, not usage questions.

Please post this question on StackOverflow where you can tag it with [rdflib].

Thanks, Nick

On Mon, Apr 25, 2022 at 12:40 am, lix joy <joylix4...@gmail.com> wrote:

> Hi, all, I'm new to RDflib, I want to implement a feature like this:
> To say, Person hasProperty Weight(kg) , Height(m), and BMI (Body Mass 
> Index)=Weight/Height^2, so if Bob‘s Weight=70, Height=1.75, How to deduce 
> Bob's BMI from this model?
> I use the following RDF file to store the above information:
>
> @prefix : <http://ex.org/BMI#> .
> @prefix owl: <http://www.w3.org/2002/07/owl#> .
> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
> :Person rdf:type owl:Class;
> :hasProperty :Height, :Weight, :BMI.
> :OriginalProperty rdf:type owl:Class .
> :DerivedProperty rdf:type owl:Class .
> :Weight rdf:type owl:Class ;
> rdfs:subClassOf :OriginalProperty .
> :Height rdf:type owl:Class ;
> rdfs:subClassOf :OriginalProperty .
> :BMI rdf:type owl:Class ;
> rdfs:subClassOf :DerivedProperty ;
> :equalTo [:divide (:Weight [:power :Height])] .
> :MathOperator rdf:type owl:Class .
> :equalTo rdf:type owl:Class ;
> rdfs:subClassOf :MathOperator .
> :divide rdf:type owl:Class ;
> rdfs:subClassOf :MathOperator .
> :power rdf:type owl:Class ;
> rdfs:subClassOf :MathOperator .
> :Bob rdf:type owl:NamedIndividual , :Person ;
> :hasProperty :BMIOfBob ,
> :HeightOfBob ,
> :WeightOfBob .
> :HeightOfBob rdf:type owl:NamedIndividual , :Height ;
> :hasValue 1.75 .
> :WeightOfBob rdf:type owl:NamedIndividual , :Weight ;
> :hasValue 70 .
> :BMIOfBob rdf:type owl:NamedIndividual ,:BMI.
>
> My idea is to read all the formulas for DerivedProperty through RDFLIB,
> Bob's BMI was then calculated in python. Now my question is how do I read all 
> the associated information of this blank node in "equalTo" by rdflib?
> Or is there a better way to implement the functionality of this model with 
> RDF?
>
> Thank you for any help and advice.
>
> Joylix
>
> --
> http://github.com/RDFLib
> ---
> You received this message because you are subscribed to the Google Groups 
> "rdflib-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rdflib-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> [https://groups.google.com/d/msgid/rdflib-dev/006d3417-54e7-4ced-9b3a-b5f360ab837dn%40googlegroups.com](https://groups.google.com/d/msgid/rdflib-dev/006d3417-54e7-4ced-9b3a-b5f360ab837dn%40googlegroups.com?utm_medium=email&utm_source=footer).

-- 
http://github.com/RDFLib
--- 
You received this message because you are subscribed to the Google Groups 
"rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rdflib-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rdflib-dev/oEJko4WXpugfRPE4T6MywiC8eQI1y3Xxnc2iwv2Cz4O4sVc0uLhqq8k1PYM2G1qehYPIT2eBXKRseUPNVwQzhYIgjIwNuiucnYy9V2jda_A%3D%40kurrawong.net.

Reply via email to