views:

1337

answers:

8

I don't understand the meaning of semantic and the meaning of syntax! What are they? And what's the difference between things like "semantic website vs. normal website", "semantic social networking vs. normal social networking" etc...

I don't get it! HELP!

+9  A: 

Syntax is the grammar of a language - the rules by which to form sentences or expressions.

Semantics is the meaning you are trying to express with your code.

mstrobl
A: 

Have you read the wiki article that discusses Semantics? It also discusses syntax.

EBGreen
+4  A: 

If you are talking about web (rather than programming languages):

The syntax of the language is whatever the browser (or processing program) can legally recognize and handle, and render to you. For example, your browser can render HTML, while your API can parse XML trees.

Semantics involve what is actually being represented. There's a lot of buzz now about semantic webs and all that stuff, but it essentially means that each entity is also associated with some human-readable information or metadata, so that a certain tag would have a supposed meaning and refer you to it.

Social networks are the same story. You put knowledge in the links

Uri
thanks i like your answer too, I wish i could select TWO accepted answers
John
A: 

Semantic web sites use the concept of the semantic web, which aims to bring meaning to web content by using special annotations to identify certain concepts in a page. This makes possible the automatic (by a computer, not a human) reasoning about the content, which improves its aggregation, extraction, indexing and searching.

+15  A: 

Syntax is the grammar. It describes the way to construct a correct sentence. For example, this water is triangular is syntactically correct.

Semantics relates to the meaning. this water is triangular does not mean anything, though the grammar is ok.

Talking about the semantic web has become trendy recently. The idea is to enhance the markup (structural with HTML) with additional data so computer could make sense of the web pages more easily.

Christian Lescuyer
thanks! everyone else gave good answers too, but yours made the most sense to me
John
And in HTML specifically, the "semantic web" is the idea that your HTML code should carry meaning. Don't use a table if you aren't actually showing tabular data. Use the tags that best explain the *meaning* of your document, not the ones that makes it look the way you want. That's what CSS is for.
jalf
+1  A: 

Specifically, semantic social networking means embedding the actual social relationships within the page markup. The standard format for doing this as defined by microformats is XFN, XHTML Friends Network. In regards to the semantic web in general, microformats should be the go-to guide for defining embedded semantic content.

Lex
A: 

"An ant ate an aunt." has a correct syntax, but will not make sense semantically. A syntax is a set of rules that can be combined to produce infinite number of gramatically valid sentences, but few, very few of which has a semantics.

yogman
+1  A: 

A program that is syntactically correct will compile and run.

A program that is semantically will actually do what you as the programmer intended it to do. i.e. it doesn't have any bugs in it.

Two programs written to perform the same task in different languages will use different syntaxes, but semantically they could be the same.

Sam Hasler