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

  • Home
  • SEARCH
  • 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 3304762
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:05:47+00:00 2026-05-17T21:05:47+00:00

I wish to save some semantic information about data in a table. How can

  • 0

I wish to save some semantic information about data in a table. How can I save this information in MySQL, such that I can access data and also search for the articles using the semantic data.

For example, I have a article about Apple and Microsoft. The semantic data will be like
Person : Steve Jobs
Person : Steve Ballmer
Company : Apple
Company : Microsoft

I want to save the information without losing the info that Steve Jobs and Steve Ballmer are persons and Apple and Microsoft are companies. I also want to search for articles about Steve Jobs / Apple.

Person and Company are not the only possible types, hence adding new fields is not viable. Since the type of the data is to be saved, I cannot use FullText field type directly.

Update – These are two options that I am considering.

  1. Save the data in a full text column as serialized php array.
  2. Create another table with 3 columns

—

--------------------------------  
| id | subject | object        |
--------------------------------
|  1 | Person  | Steve Ballmer |
|  1 | Person  | Steve Jobs    |
|  1 | Company | Microsoft     |
|  1 | Company | Apple         |
|  2 | Person  | Obama         |
|  2 | Country | US            |
--------------------------------
  • 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-05-17T21:05:47+00:00Added an answer on May 17, 2026 at 9:05 pm

    You’re working on a hard and interesting problem! You may get some interesting ideas from looking at the Dublin Core Metadata Initiative.

    http://dublincore.org/metadata-basics/

    To make it simple, think of your metadata items as all fitting in one table.

    e.g.

    Ballmer employed-by Microsoft
    Ballmer is-a Person
    Microsoft is-a Organization
    Microsoft run-by Ballmer
    SoftImage acquired-by Microsoft
    SoftImage is-a Organization
    Joel Spolsky is-a Person
    Joel Spolsky formerly-employed-by Microsoft
    Spolsky, Joel dreamed-up StackOverflow
    StackOverflow is-a Website
    Socrates is-a Person
    Socrates died-on (some date)
    

    The trick here is that some, but not all, your first and third column values need to be BOTH arbitrary text AND serve as indexes into the first and third columns. Then, if you’re trying to figure out what your data base has on Spolsky, you can full-text search your first and third columns for his name. You’ll get out a bunch of triplets. The values you find will tell you a lot. If you want to know more, you can search again.

    To pull this off you’ll probably need to have five columns, as follows:

    Full text subject  (whatever your user puts in)
    Canonical subject (what your user puts in, massaged into a standard form)
    Relation (is-a etc)
    Full text object
    Canonical object
    

    The point of the canonical forms of your subject and object is to allow queries like this to work, even if your user puts in “Joel Spolsky” and “Spolsky, Joel” in two different places even if they mean the same person.

    SELECT * 
      FROM relationships a
      JOIN relationships b (ON a.canonical_object = b.canonical_subject)
     WHERE MATCH (subject,object) AGAINST ('Spolsky')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder if anyone can help, i wish to save a variable globally for
This code below is using the FWRITE function. however i wish to save the
I have created save.plist in a resource folder. I have written some data within
I wish Subversion had a better way of moving tags. The only way that
I wish to know all the pros and cons about using these two methods.
I wish to implement my software on a shareware basis, so that the user
I wish I were a CSS smarty .... How can you place a div
I wish to search a database table on a nullable column. Sometimes the value
I wish to test a function that will generate lorem ipsum text, but it
I wish there was a central, fully customizable, open source, universal login system that

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.