Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8448423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:25:25+00:00 2026-06-10T10:25:25+00:00

A Beginner question about the semantic web. I have a knowledge base of colors

  • 0

A Beginner question about the semantic web.

I have a knowledge base of colors which includes similar colors, color modifiers (dark, light, ~ish, etc), color relations (darker, brighter), color synonyms, etc. I am trying to figure out if RDF/OWL is a good choice to manipulate (mainly query) this KB. Here are the queries I need to support.

1) Find all colors similar to a given color. If I represent color similarity with a “similar” predicate, a simple Sparql query will do. Same for synonyms and relations. Good.

2) The problem becomes more tricky when I need to find if a token or phrase x is a valid color. If x is an unmodified color, the problem can be solved by creating a Color class and making sure all the known colors are instances of that class. But what if x is a modified color like “redish” ? Obviously, one solution would be to have all the modified colors part of the KB by adding them explicitly.

But, is it possible to add all the modified colors automatically to the RDF? In other words, is it possible to define a class of modified colors that would entail all modified colors? This requires some concatenation operator. Is that at all possible?

Another solution would be to have some logic to decompose x and check a) if it contains a known modifier and b) if the modified thing is a valid color. Of course, I’d like this logic to be described in RDF/OWL as well. Any idea?

Thanks in advance for any input or suggestion.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:25:26+00:00Added an answer on June 10, 2026 at 10:25 am

    What you want to do seems to be better handled, IMO, with a custom piece of code in your favourite programming language. Difficult to express these kinds of things in OWL, and certainly not efficient.

    But FWIW, here is something you can do. Fasten your seat belt, here begins a trip to advanced OWL 2 modelling. Assume that you have the base colours “blue”, “green”, “red”. You can define a datatype that includes the three strings (I use Turtle syntax):

    :baseColor  a  rdfs:Datatype;
        owl:equivalentClass  [
            a  rdfs:Datatype;
            owl:withRestrictions ( [ xsd:pattern "blue|green|red" ] )
        ] .
    

    Then you can define modified colours:

    :modColor  a  rdfs:Datatype;
        owl:equivalentClass  [
            a  rdfs:Datatype;
            owl:withRestrictions (
                [ xsd:pattern "(dark|light)?(blue|green|red)(ish)?" ]
            )
        ] .
    

    you could even have more datatypes such as :lightColor, :darkColor, mediumColor.

    Then you make a class :Color that has a datatype property :hasColor:

    :hasColor  a  owl:DatatypeProperty;
        rdfs:domain  :Color;
        rdfs:range  [
            a  rdfs:Dataype;
            owl:unionOf  ( :baseColor :modColor )
        ]
    :Color  a  owl:Class;
        rdfs:subClassOf  [
           a  owl:Restriction;
           owl:onProperty  :hasColor;
           owl:someValuesFrom  xsd:string
        ];
        owl:hasKey  ( :hasColor ) .
    

    Here, I impose that instances of :Color have at least a color string and I impose that the color string is a unique identifier for the color (it’s a key). So, whenever I have a color given with its color string, I can verify that the string is in the regex patterns given above. Assuming I defined the datatypes :darkColor, :lightColor and :mediumColor, I can also express the :darker and :lighter relations:

    :DarkColor  a  owl:Class;
        rdfs:subClassOf  :Color, [
            a  owl:Restriction;
            owl:onProperty  :hasColor;
            owl:allValuesFrom  :darkColor
        ] .
    :LightColor  a  owl:Class;
        rdfs:subClassOf  :Color, [
            a  owl:Restriction;
            owl:onProperty  :hasColor;
            owl:allValuesFrom  :lightColor
        ] .
    :MediumColor  a  owl:Class;
        rdfs:subClassOf  :Color, [
            a  owl:Restriction;
            owl:onProperty  :hasColor;
            owl:allValuesFrom  :mediumColor
        ] .
    

    Then you want to say that all :DarkColors are :darker than all :MediumColor and all :LightColor. Such an axiom is not trivial to implement as it demands to introduce auxiliary terms. It is explained in the paper All Elephants are Bigger than All Mice and it’s called, in DL terminology, concept product:

    :p1  a  owl:ObjectProperty . # auxiliary property (do not reuse elsewhere)
    :p2  a  owl:ObjectProperty . # idem
    :x  a  owl:Thing .           # auxiliary individual
    :darker  owl:propertyChainAxiom ( :p1 :p2 ) .
    :DarkColor  rdfs:subClassOf  [
        a  owl:Restriction;
        owl:onProperty  :p1;
        owl:hasValue  :x
    ] .
    [ owl:unionOf ( :LightColor :MediumColor ) ] rdfs:SubClassOf  [
        a  owl:Restriction;
        owl:onProperty  [ owl:inverseOf :p2 ];
        owl:hasValue  :x
    ] .
    

    Do the same for :lighter.

    You can’t really introduce the modified colours automatically. You really have to provide a pattern that contain all the base colors + the modifiers. But this can easily be done programmatically. In any case, the OWL code that I give should not be used, IMO, as it’s much better/more efficiently addressed by a customised programme.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about ocaml, i'm a beginner :-) Here is an example
I'm beginner in SWT and I have a question about get values between differents
Total beginner question about jQuery: I have a Form that contains several TextBoxes (input
I have a beginner question about dates and String in Haskell. I need to
I have a beginner's question about releasing variables and not wasting memory... I don't
Git beginner question: I have a small private webproject which is versioned locally with
I have a beginner's question. I was wondering about the level of subviews and
im a beginner with DataMapper ORM, so i have question about complex querying. First,
I'm a beginner in computer vision. I have a question about detection and tracking.
I'm following a tutorial. (Real World Haskell) And I have one beginner question about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.