What is the difference between "attribute" and "property"? [closed]
Could you please clear up the meaning of these two words for me?
I don't understand this sentence:
Attributes introduced by RDFA have names. For example, property is one such attribute.
Solution 1:
Generally, attribute means a particular characteristic or ability which something or someone has, like curly hair or a short temper, or the ability to make really good coffee.
So an applicant for a job might be asked in an interview what attributes they have which would make them suitable.
Property would be used similarly, but usually in discussions of more abstract concepts, like an idea, a branch of mathematics or an economic policy.
E.g. What property of certain regular polygons allows them to be faces of the Platonic Solids?
But for the phrase you mention (the phrase comes from this PDF, a technical document explaining RDF technologies), attribute has a precise technical meaning. If you wanted to express in XML the idea of a kid with a short temper, you might write something like this:
<Kid temper="short"/>
Here the attribute is named "temper", and the value of that attribute is "short".
It's unfortunate that the example you quote suggests an attribute named property, because "attribute" and "property" are used interchangeably in discussions about XML. So when the paragraph you quoted continues with:
Obviously, when we make reference to this attribute, we say attribute
property
.
it starts to look confusing.
All I can add to clarify it here is to point out that in the code representation (an object in some programming language) we would call "temper" a property, but the corresponding thing in the XML is referred to as an attribute).
I think any further discussion of this really belongs on Stack Overflow.
Solution 2:
Both words can be synonyms in one sense. But property may refer to one's belongings, which attribute cannot; and attribute may also be a verb, which is not true of property.