Friday, 21 August 2015

Using SWRL built-ins in CNL ontology

The Semantic Web Rule Language (SWRL) is an expressive OWL-based rule language. SWRL extends OWL syntax which allows users to write rules with more powerful deductive reasoning capabilities than OWL alone. SWRL built-ins are one of SWRL’s powerful features, which are predicates to be used to manipulate data values in SWRL rules.

From the latest version, Fluent Editor supports a number of core SWRL built-ins defined in SWRL Built-in Submission. In this post, we will introduce two examples of applying some of SWRL core built-ins to your CNL ontology.



Using Simple Built-in Comparison


Here, we will use a short ontology template which uses a couple of built-ins to express simple rent comparison. To open it, go to New page and type 'Rent Comparison'. A green template icon will appear. Click it.

Then let's take a look at the template. First, we define a tenant has three data values....
Every tenant pays-monthly-rent (some integer value).
Every tenant has-rental-flat-size (some integer value).
Every tenant lives-in-area (some string value).

... and some tenant instances.
Tom is a tenant and has-rental-flat-size equal-to 65 and pays-monthly-rent equal-to 2000 and lives-in-area equal-to 'New York'.
John is a tenant and has-rental-flat-size equal-to 60 and pays-monthly-rent equal-to 2500 and lives-in-area equal-to 'New York'.
Mary is a tenant and has-rental-flat-size equal-to 85 and pays-monthly-rent equal-to 2500 and lives-in-area equal-to 'Florida'.
Anna is a tenant and has-rental-flat-size equal-to 60 and pays-monthly-rent equal-to 1800 and lives-in-area equal-to 'Georgia'.

Then we add three rules defined for comparing rent using those data values. Each of the rules contains different built-ins as follows :
If a tenant pays-monthly-rent equal-to the value(1) and the tenant has-rental-flat-size equal-to the value(2) and the value(1) divided-by the value(2) = the value (3) then the tenant pays-monthly-rent-per-size equal-to the value (3).
If a tenant(1) pays-monthly-rent-per-size equal-to the value(1) and a tenant(2) pays-monthly-rent-per-size equal-to the value(2) and the value (1) < the value (2) then the tenant(1) lives-in-a-cheaper-flat-than the tenant(2).
If a tenant(1) lives-in-a-cheaper-flat-than the tenant(2) and the tenant(1) lives-in-area equal-to the value(3) and the tenant(2) lives-in-area equal-to the value(4) and the value(3) <> the value(4) then the tenant(1) lives-in-a-cheaper-area-than the tenant(2).
The first rule describes how to calculate rental price per flat size, which simply means:  rental price per apartment size =  total monthly rental price / flat size 
Here you can see that an SWRL built-in swrlb:divide is represented as a keyword divided-by, taking two operands : the value (1and the value (2). The result value is assigned to the new value, the value (3) . Once you assign some data to this new value, you can apply it to some other properties, such as pays-monthly-rent-per-size.

The second rule is a straightforward comparison of rental price between tenants, which is expressed by using a keyword '< ',  an equivalent of built-in swrlb:lessThan.

The last one is comparing both rental price per flat size and the area where tenants live, to calculate which area is more expensive. A keyword '<>' is used that represents swrlb:notEqual to check that the area names are different.  


To check how these rules with built-ins work, you can get back the full results in three ways as follows:
1. Querying on Materialized Graph.



2. Querying on SPARQL window.

3. Running SWRL Debugger.



Expressing Solar System Data Using Built-ins


The next ontology is expressing solar system data on the orbits of the planets and moons along with some historical data. To express the data we can also make use of SWRL built-ins. First we can open the template 'Solar System' and take a look at the rules there.

For example, this rule involves several math built-ins. It calculates orbits which are elliptic.
If a thing has-semimajor-axis-1000-km equal-to the value(1) and the thing has-eccentricity equal-to the value(2) and 1.0 - the value(2) = the value(3) and 1.0 + the value(2) = the value(4) and the value(1) * the value(3) = the value(5) and the value(1) * the value(4) = the value(6) then the thing has-peryhelium-1000-km equal-to the value(5) and the thing has-aphelium-1000-km equal-to the value(6).
The built-in keywords here look exactly the same as mathematical signs. '+' is equivalent to swrlb:add, '-' to swrlb:subtract, and '*' to swrlb:multiply, If you break down the rule as below...
   value(1) = has-semimajor-axis-1000-km
   value(2) = eccentricity
   value(3) = 1.0 - eccentricity
   value(4) = 1.0 + eccentricity
   value(5) = has-semimajor-axis-1000-km * (1.0 - eccentricity)
   value(6) = has-semimajor-axis-1000-km * (1.0 + eccentricity) 

...it concludes that this rule is defining two equations.
      peryhelium = (1 - eccentricity) * semimajor-axis
   aphelium = (1 + eccentricity) * semimajor-axis

Here is another rule comparing orbit sizes (ellipse) of two different planets that orbit the same thing.
If a thing(2) orbits the thing(1) and a thing(3) orbits the thing(1) and the thing(2) is-not-the-same-as the thing(3) and the thing(2) has-peryhelium-1000-km equal-to the value(1) and the thing(3) has-aphelium-1000-km equal-to the value(2) and the value(1) < the value(2) then the thing(2) is covered by the thing(3).
It compares if planetA's value of peryhelium-1000-km is less than planetB's value of aphelium-1000-km, to conclude that if one makes a bigger ellipse then it covers the other.

Let's add a couple of planet instances to see how the rules would work.
Sun is a star.
Mercury has-index equal-to 'I' and orbits Sun and has-semimajor-axis-1000-km equal-to 57910 and has-period equal-to 87.97 and has-eccentricity equal-to 0.21.
Venus has-index equal-to 'II' and orbits Sun and
has-semimajor-axis-1000-km equal-to 108200 and has-period equal-to 224.70 and has-eccentricity equal-to 0.01.
Then query on Materialized Graph.

Among the results you will find the derived knowledge that Mercury is covered by Venus.

More Resources:





23 comments:

  1. Clinical ontology is not an easy thing as one of my friends is doing it when we were sitting together. As I had no idea that what he is doing and I even forgot to do my assignment, for which we had to purchase assignment online in UK to get done with the submission on time. Because it was delayed enough that I wasn’t able to do my work on time.

    ReplyDelete
  2. As I had no idea what he was doing, and I even neglected to do my assignment, we had to business management dissertation help to complete the submission on time. Because it was delayed long enough that I couldn't complete my task on time.

    ReplyDelete
  3. This time is to get a newly ideas . So are you ready to collect the new and inspiring words through my side. Contact with us.
    Samsung Phone Repair Services

    ReplyDelete
  4. This is my passion to explore the new sites which deliver us a required information that was we are searching. I really admire this post each and every word are so descriptive and meaningful. Satisfy after view it. Thank you.
    shearling coats and jackets

    ReplyDelete
  5. I am appreciating to your efforts, That show you in this blog.
    eden perfumes discount code

    ReplyDelete
  6. This is very nice guys! Hey and ho! If you really need help with essay writing or homework, or you just want to save your money, use this essay writer and be ready for professional ewriter reviews help! Good luck, have fun!

    ReplyDelete
  7. The higher the amount of data, the harder it is to handle. To protect data values and avoid manipulation, the use of Semantic Web Rule Language would be constructive. I have just read Dissertation Help UK and I also find it very useful in terms of data management.

    ReplyDelete
  8. Exploring new websites that provide us with the information we need to make decisions is my passion. I adore this post because each and every word is so insightful and evocative. satisfied after viewing it. I'm grateful. ecommerce web design solution

    ReplyDelete
  9. If you are also looking for a best personal loan app
    then visit on TrueBalance

    ReplyDelete
  10. Amazing information provided by the author through this post, and if you're looking to purchase one of the cheapest celebrity leather jackets or coats, click here. We have a wide selection of leather jackets to choose from, with our firm's most well-known offering being yellowstone mens jackets at an affordable price.

    ReplyDelete
  11. The applicant's prior behavior is not taken into account by the admissions screening committee essayhub.com reviews

    ReplyDelete
  12. SWRL (Semantic Web Rule Language) is a powerful language used to represent and infer complex relationships and rules within Semantic Web knowledge bases. If applied to the context of legal matters, such as those involving like nolan per saud laywers, SWRL could be employed to model intricate legal rules and relationships, enabling automated reasoning and decision support systems.

    ReplyDelete
  13. The completion of a divorce in New York is usually contingent upon a number of criteria, including the intricacy of the case and the availability of the court. Divorces that are uncontested typically end in a few months, but those that are contested may take longer. For precise case-specific timelines, legal professionals must be consulted. When is Divorce Final in New York

    ReplyDelete
  14. The stakeholder is the source of revenue Affiliate platform that rewards associates for his or her determination and achievement.

    ReplyDelete
  15. The most demanding facility at Rite Way cheap towing services participates in protection consciousness packages.

    ReplyDelete
  16. SWRL's integration with OWL enhances reasoning in the Semantic Web. Its rule language empowers users with advanced deductive capabilities. The inclusion of SWRL built-ins further enriches data manipulation within rules. Overall, SWRL stands as a pivotal tool for semantic reasoning and knowledge representation. New York Uncontested Divorce Lawyer
    Top Divorce Lawyers in New York

    ReplyDelete
  17. Five nights at Freddy's is a first-person horror game where you play as a security guard working at a pizza shop with scary robots.
    Your main task is to stay safe throughout the five nights by using camera systems for surveillance and doors to prevent mysterious robots from entering.
    This game creates a feeling of tension and anxiety as players must intelligently manage their energy and time to avoid being attacked by robots.

    ReplyDelete

  18. SWRL (Semantic Web Rule Language) is a rule language that can be used to Palworld Breeding Calculator express relationships between elements in ontologies.

    ReplyDelete
  19. My love is discovering new websites that offer us the data we need to make decisions. This post is amazing because every single word is so poignant and powerful. pleased after seeing it. I'm really grateful.
    ged math test

    ReplyDelete
  20. Integrate SWRL rules into your CNL ontology. SWRL rules are typically expressed in a syntax that geometry dash lite combines OWL and SWRL constructs.

    ReplyDelete
  21. This comment has been removed by the author.

    ReplyDelete
  22. In California, whether you require armed or unarmed security services, our offerings prioritize your safety and protection. Armed/unarmed service in California Our dedicated team of professionals ensures round-the-clock vigilance, tailored to your specific needs. With extensive training and expertise, our guards are equipped to handle any situation effectively. Whether armed or unarmed, we employ the latest technology and proactive measures to safeguard your assets and maintain peace of mind. Choose our trusted security services in California for reliable protection, regardless of your preference for armed or unarmed guards.

    ReplyDelete
  23. A digital platform focused on sharing news, reviews, and insights related to technology and innovation. Topics often include gadgets, software, cybersecurity, AI, and tech industry trends. The blog serves both tech enthusiasts and professionals, offering expert analysis and how-to guides. Regular updates aim to keep readers informed about the latest in consumer electronics, startups, and major tech companies. Tech blogs are popular for breaking down complex topics into accessible content for a broad audience.
    Tax Evasion Lawyer
    Tax Fraud Lawyer







    ReplyDelete