web development – Is it hard to “add” semantic web to your website?

This quote means that if you are used to design web-sites and produce web-content, you may be an expert in structuring and presenting information, but might not necessarily be aware of how to add information about the information.

This does not mean that you have to be a knowledge engineer to succeed. But it means that you have to learn additional languages, to document the meaning (semantic) of the information you put on the web.

The relation between the web and the semantic web, is somewhat similar to the relation between object oriented programming in a programming language, and modeling in UML the objects and their relation. You can be a perfect programmer (implementation), have a perfect understanding of the high-level design that you have implemented (abstraction), but if you do not know the UML language, you’ll have to learn it if you want to express the knowledge about your code.

This analogy is not perfect: programing language are very well formalized. There are tools that can reverse engineer code to deduce UML diagrams. You’d then only have to complete missing information (e.g the meaning of an association, or some characteristics that are not obvious in the code, etc…). In the semantic web, the content can be highly unstructured, so it’s much lore difficult to automate the identification of the concepts and their relation. And consequently, the addition of this (optional) information requires more effort.

beginner – Very simple semantic implementation of the structure of a web page with three elements: header, main, and footer, using Flexbox

I’m new to web development, and currently learning the basics of HTML and CSS. Many web pages follow the structural pattern of header, main, and footer; so I figured it’d be a good idea to try and implement this structure to see how things are carved.

This is my attempt:

body {
  display: flex;
  flex-direction: column;
  font-family: sans-serif;
  margin: 0;
  min-height: 100vh;
}

header,
footer {
  background-color: dodgerblue;
  color: white;
  text-align: center;
}

main {
  background-color: snow;
  flex: 1;
  padding: 1rem;
}

footer {
  margin-top: auto;
}
<!DOCTYPE html>

<html lang="en">

<head>
  <title>Test</title>
  <link rel="stylesheet" href="main.css">
  <meta charset="UTF-8">
</head>

<body>
  <header>
    <h1>Header</h1>
  </header>

  <main>
    <h2>Main content</h2>
  </main>

  <footer>
    <h3>Footer</h3>
  </footer>
</body>

</html>

I’m looking for all kinds of feedback, from style, to anti-patterns, ways to do things more concisely, and whatever other observation you can find useful. I do have some specific questions:

  1. Are the semantic HTML elements used correctly? There’s no need for an article element inside the main element, right?
  2. In the CSS I selected both header and footer for stuff that they have in common, is this good practice? Or should I keep a single header and a single footer selectors, separately? Could be more maintainable that way?
  3. Is this normally handled using Flexbox? Or is Grid display a better tool for this?
  4. What things would you do differently?

Thanks for your time!

html5 – Semantic HTML for a card component

How can I escape the pitfall of using divs for everything in this, where can I substitute them with semantic tags? I am doing this a part of a exercise and I know it’s important to use semantic HTML tags.

  <!-- Card -->
  <div class="card">
    <div class="card__showcase">
      <a href="#" class="card__link"><img src="https://codereview.stackexchange.com/img/arrow-back.svg" alt="Backwards pointing arrow"> Back</a>
    </div>

    <!-- Card body -->
    <div class="card__body">
      <nav class="card__nav">
        <a href="#" class="card__link">Netherlands</a>
        <a href="#" class="card__link">Spain</a>
        <a href="#" class="card__link">France</a>
      </nav>

      <!-- Card content -->
      <div class="card__content">
        <h2 class="card__title">Visiting the pastelle city</h2>
        <p class="card__byline">By <strong>Jerry Henderson</strong>, in Toursim</p>
        <div class="card__images">
          <img src="img/preview.jpg" alt="An preview image of a old style window" class="card__thumbnail">
          <a href="#">View all photos <img src="img/arrow-forward.svg" alt="Fowards pointing arrow"></a>
        </div>
        <p class="card__text">
          As you drive into the town
          from Alicante airport you will pass
          between two salt lakes - one is 
          blue/green and the other is an impressive pink colour.
        </p>
      </div><!-- Card content -->
    </div><!-- Card body -->

  </div><!-- Card -->

Functional programming – what does this semantic specification do when shuffling a single card from a deck?

I have 2 constructor functions and 2 additional functions:

declare: d,d' = deck; c, c' = card

Constructor 1)

CreateDeck();

Constructor 2)

addCard(d,c);

additional 1)

addCardRandomly(d', c');

additional 2)

CardsInTheDeck(d'); 
(it returns "CardsInTheDeck(d)+1" when called with addCard(d,c) constructor obviously)

Now what happens when the function addCardRandomly(d',c') means with that addCard(d,c) Constructor?
This is the semantic specification of the book:

if    random(CardsInTheDeck(d') = CardsInTheDeck(d')+1):
then  addCard(d',c');

else addCard(addCardRandomly(d, c'), c);

What I think is:
Since a deck of cards can be treated as a queue, we can take card c that our constructor must insert into the deck and:
if random returns the first position of the queue
Then just put the card in this position.

Otherwise, swap this card for the card we just picked at random and insert the cards above the card at that position once over the card we chose ourselves.
For example:

Cards are 1 2 3 4 5 6 7 8

We have to insert 9

if random = 5

it becomes 1 2 3 4 9 5 6 7 8

(Case where randomly = 9 is omitted because trivial)

Is it right? What makes this recursive specification so complex? How can I visualize and understand these types of ideas in general? How can I explain this concept when the final solution is reached? It looks so complex to me.
Thanks a lot!

Design – How do I identify the concepts of the lexical, syntactic and semantic level?

Waze

I'm trying to identify that lexical. syntactic and semantic Concepts on this Waze application screen, but I don't know if I really understood these concepts.

Are buttons considered a lexical level?

Is the function that performs the button syntactic?

Is the general idea of ​​the Waze app the semantic level?

Can anyone elaborate on these concepts and say what each element of this screen represents and why?

How to change the semantic version number when you undo the last major change

I am trying to plan a system that checks the compatibility of different components by comparing their semantic version number, especially the major version number (as this indicates API changes and backward compatibility). I came across the following scenario where I couldn't find an exact answer:

Suppose the code is in the version 2.3.5 and I’ll add a new major API change, so I’ll update the version 3.0.0, However, a few days after the release, I find that this change does not meet users' needs and I undo this change so that everything that was compatible with the versions 2.x.x will be compatible again (note that I'm not resetting version control, I'm putting the old version of the code back in a regular commit). Now I can't figure out if the new version should be 4.0.0 because I have made a major API change again and the numbers should always be incremented, or because it is backwards compatible again 2.4.0,

I see advantages and problems with both solutions. Are there basic rules or best practices for such cases?

design – What is the preferred way to check, ignore, or report a JSON array parameter for semantic input "set" on a blog website?

I am developing a blog website that contains a list of tags for each post, just like the stackoverflow.

There is no doubt that I will suspend an API-like on the server side blog/edit to the client side, and the request parameter such as:

class BlogEditParam{
    private List tags;
}

So I definitely have to validate them tags Field on the server side, like checking whether the tag name is present or not, I have no doubt about it.

The tags Field has a "set" semantics, there must be no duplication. For example, a post cannot have a tag list like the following:
c++, java, c++

What should I do when it comes to the possible doubling of the input parameters? It seems to me that I have two strategies:

  1. just ignore it in silence. For the example shown above, I remove all duplicates on the server side and accept this request (of course the c++ and java Day must pass the existing validation
  2. Report an error to the client if you notice such a duplication

What is the preferred way in this blog application scenario?


I use Spring Boot as a server-side framework. I know that I can write the input parameter like this:

class BlogEditParam{
    private Set tags;
}

In fact, it only ignores duplication when deserialization is done, just like the first strategy I mentioned above.

Machine Learning – What is the main concept of using a lexical, linguistic, semantic or syntactic approach in NLP for cyberbullying?

I'm really in need of an explanation and I'm working on an nlp cyberbullying detection tool that I'm going to implement on the web using the Django framework. However, I am fixated on an idea, someone can explain to me … What is the main concept of I use lexical, linguistic, semantic or syntactic approaches in (NLP) and know how they are used in cyberbullying A synonym for semantics because pos Tagging is a process that connects words with root and representative word in an understandable context. Correct me if wrong.

I read an article in which an article started a project using a predictive analysis approach with feature extraction techniques and Navie Baye to classify and train the model. The discussion also discussed how other teams used the semantics approach to classify cyberbullying. I am familiar with data cleansing, tokenization stemming and most feature extraction models. However, I am faced with the problem of the approach, which is relevant to lexical, semantic or syntactic aspects and how to deal with them.