Schema.org is ProfessionalService deprecated? - schema

After reading several recent popular articles on the internet I decided to use ProfessionalService over LocalBusiness for my web design company. It is my understanding that LocalBusiness is very broad and it is best to be as specific as much as possible and the reason why I opted to use both ProfessionalService and additionalType with The Product Types Ontology.
Using Google Tag Manager my json-ld looks like this:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "ProfessionalService",
"additionalType": "http://www.productontology.org/id/Web_design",
"name": "BYBE",
"url": "https://www.bybe.net",
"logo": "https://www.bybe.net/wp-content/themes/showboat/logo-bybe.png",
"description": "Creative website design company based in Bournemouth and Poole, Dorset.",
"telephone": "01202 949749",
"areaServed": ["Bournemouth", "Poole", "Dorset"],
"openingHoursSpecification": [
{
"#type": "OpeningHoursSpecification",
"dayOfWeek": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
],
"opens": "09:00",
"closes": "17:00"
}
],
"address": {
"#type": "PostalAddress",
"streetAddress": "Flat 11, East Cliff Grange, 35 Knyveton Road",
"addressLocality": "Bournemouth",
"addressRegion": "Dorset",
"postalCode":"BH1 3QJ"
},
"geo": {
"#type": "GeoCoordinates",
"latitude": "50.73744",
"longitude": "-1.8495269"
},
"sameAs" : [ "https://plus.google.com/+ByBeBournemouth",
"https://twitter.com/bybe_net",
"https://www.facebook.com/ByBeUK",
"https://uk.pinterest.com/bybenet/",
"https://www.youtube.com/c/ByBeBournemouth",
"https://www.linkedin.com/company/bybe"]
}
</script>
I'm a little confused over the choice of words Schema has used on the ProfessionalService page:
SOURCE
Original definition: "provider of professional services."
The general ProfessionalService type for local businesses was
deprecated due to confusion with Service. For reference, the types
that it included were: Dentist, AccountingService, Attorney, Notary,
as well as types for several kinds of HomeAndConstructionBusiness:
Electrician, GeneralContractor, HousePainter, Locksmith, Plumber,
RoofingContractor. LegalService was introduced as a more inclusive
supertype of Attorney.
It's not clear if ProfessionalService is completely deprecated since it is still listed on the list of Schema's, I suspect they mean its deprecated for using it in a certain way, I'd be grateful if a Schema Jedi could shed some light on this issue.
Question(s):
Is ProfessionalService completely deprecated? If it's not then please include an example demonstrating the type of usage that is deprecated, that way it'll help and others.

ProfessionalService is deprecated for all cases, not only for some specific ones.
However, it will likely never be removed from Schema.org, because it would do more harm than good: many sites might still use this type, and many of them will probably never update their structured data (or even notice that it got deprecated in the meantime).
See also what the Schema.org webmaster, Dan Brickley, says about superseded types:
We shouldn't make the warnings too heavy or it creates awkwardness e.g. when search marketing people have recommended something to their clients then it gets superseded. We want consumers to respect older structures wherever possible and not worry publishers into constantly updating in the absence of concrete product-related incentives imho.
So if you have to use this type, nothing will break (just don’t expect updates for this type, or integration with future developments of the vocabulary). But if possible, it would better to use an alternative.
If not using ProfessionalService, the closest type for your web design company would be LocalBusiness. The services (design, development, consulting, CMS updates etc.) your company provides can be modelled with Service (where the provider is the LocalBusiness) and/or with makesOffer (where the Offer can reference the Service with itemOffered) (or with hasOfferCatalog in the same way, if you want to model it as list).

Related

Is having two dependent resources not compliance with the RESTFul approach?

Context
In our project, we need to represent resources defined by the users. That is, every user can have different resources, with different fields, different validations, etc. So we have two different things to represent in our API:
Resource definition: this is just a really similar thing to a json schema, it contains the fields definitions of the resource and its limitations (like min and max value for numeric fields). For instance, this could be the resource definition for a Person:
{
"$id": "https://example.com/person.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Person",
"type": "object",
"properties": {
"firstName": {
"type": "string",
"description": "The person's first name."
},
"lastName": {
"type": "string",
"description": "The person's last name."
},
"age": {
"description": "Age in years which must be equal to or greater than zero.",
"type": "integer",
"minimum": 0
}
}
}
Resource instance: this is just an instance of the specified resource. For instance, for the Person resource definition, we can have the following instances:
[
{
"firstName": "Elena",
"lastName": "Gomez",
},
{
"firstName": "Elena2",
"lastName": "Gomez2",
},
]
First opinion
So, it seems this kind of presents some conflicts with the Restful API approach. In particular, I think it has some problems with the Uniform Interface. When you get a resource, you should be able to handle the resource without any additional information. With this design, you need to make an additional request to first get the resource definition. Let's see this with an example:
Suppose you are our web client. And you are logged in as an user with the Person resource. To show a person in the UI, you first need to know the structure of the Person resource, that is, you to do the following request: GET /resource_definitions/person. And then, you need to request the person object: GET /resource/person/123.
Second opinion
Others seem to think that this is not a problem and that the design is still RESTful. Every time you ask for something to an API, you need to know the format previously, is not self-documented in the API, so it makes sense for this endpoint to behave the same as the others.
Question
So what do you think? Is the proposed solution compliance with the RESTful approach to API design?
The simple solution is to add a link:
{
"_links": {
"describedby": {
"href": "https://example.com/person.schema.json",
"type": "application/schema+json"
}
},
"firstName": "Elena",
"lastName": "Gomez"
}
You could also put this in a header. This is semantically equivalent:
Link: <https://example.com/person.schema.json>; rel="describedby" type="application/schema+json"
It does not violate the uniform interface if there is no standard for this kind of stuff, but there is. RDF e.g. JSON-LD and schema.org vocab can handle most of these types. Even for REST there is an RDF vocab called Hydra, though the community is not that active nowadays.
As of the actual problem, I would look around, maybe RDF technologies or graph technologies are better for it, though I am not sure how much connection there is in your graph. If it is just a few types and instances, then I would probably stick to REST.
Ohh I see meanwhile, you used an actual JSON schema. Then that part is certainly uniform interface compatible. As of the instances you need to add something like type: "https://example.com/person.schema.json" and you are ok. Maybe a vendor specific JSON derived MIME type which describes what "type" means in this context if you want to be super precise or just use JSON-LD instead. https://www.w3.org/2019/wot/json-schema Or an alternative more common solution is using RDFS and XSD with JSON-LD instead of JSON Schema.

JSON API relationship with meta information

I have an entity contract with relationship contract_contacts that should be presented in JSON API format.
To be more clear here's the structure of my entities:
Contract
id
name
ContractContact
contract_id
contact_id
type
comment
Contact
id
name
Possible JSON API output will look like:
{
"data": {
"type": "contracts",
"id": "1",
"attributes": {
"name": "Contract 1"
},
"relationships": {
"contacts": {
"data": [
{
"type": "contract_contacts",
"id": "1"
},
{
"type": "contract_contacts",
"id": "2"
}
]
}
}
}
}
This approach is not good enough - you have to create additional resource for relation where you will store your contact and comment with type. You have to include with 2 levels deep to get you contact fields. Also in this case to create contract frontend should work with both resources:
Create contract contact and get id
Then Create contract with relationship
with id from above
The second approach is seems hacky to me because it will use meta and it's up to you how to use it. Example:
{
"data": {
"type": "contracts",
"id": "1",
"attributes": {
"name": "Contract 1"
},
"relationships": {
"contacts": {
"data": [
{
"meta": {
"comment": "comment 1",
"type": 1
},
"type": "contacts",
"id": "10"
},
{
"meta": {
"comment": "comment 2",
"type": 2
},
"type": "contacts",
"id": "11"
}
]
}
}
}
}
This approach will simplify the mess with api requests that was in previous example.
But is that correct to POST/PUT/PATCH with meta fields as they are not supposed to be changed from client (or supposed to be)? I'm confused with this part.
The relationship that you are describing is often referred to as a has-many-through relationship: A contract has a many contacts through a contract_contacts. These is defined as a relationship that links two resources through an intermediate resource.
JSON:API specification does not provide first-level support for these kind of relationship. You should instead model them through separate resources as described by you as your first option. This allows you to create, modify and delete your intermediate resource in the same way as any other resource. Doing so reduces the complexity as the intermediate resource is just another resource type as any other.
You mentioned two problems with doing so:
You have to include with 2 levels deep to get you contact fields.
This is true but shouldn't be an issue. include query parameter allows your client to sideload resources any many level deep as it needs. The response document might be a little bit bigger than it would be if the information of the intermediate resource is stored on the relationship itself but that shouldn't be relevant in production after gzip.
Also in this case to create contract frontend should work with both resources:
Create contract contact and get id
Then Create contract with relationship with id from above
This is true and a serious limitation of the current stable version of JSON:API specification (v1.0). It's not directly related to has-many-through relationships so. It's a general limitation of the specification, which does not support creating, modifying and/or deleting more than one resource with one request.
An official Atomic Operations extension is proposed for v1.1 of the specification to address that limitation. It's very likely that these one or a similar proposal will be included in the upcoming version.
It might be tempting to store the information of the intermediate model as meta data on the relationship. But doing so will introduce serious limitations which for I would strongly recommend to not take that path:
The JSON:API specification does not cover changing meta data. You would need to introduce your own specification to create or update these meta data.
Client-side libraries for the JSON:API specification do not expect such information to be available as meta data of the relationship. It's very likely that the consumers will have a hard time processing the information.
Storing information of the intermediate resource would lock you into using resource linkage to express relationship information in a resource document. You would not be able to use related resource links. These may introduce serious performance issues as resource linkage requires to always lookup the IDs of related resources in the database, which is not required if using related resource links.

Using of structured data markup with review authority

I'm trying to structured data for producing the review like this on google search (please see the image) -
According to this link I've to write the following structured data markup -
<script type="application/ld+json">
{
"#context": "http://schema.org/",
"#type": "Review",
"itemReviewed": {
"#type": "Thing",
"name": "Super Book"
},
"author": {
"#type": "Person",
"name": "Joe"
},
"reviewRating": {
"#type": "Rating",
"ratingValue": "7",
"bestRating": "10"
},
"publisher": {
"#type": "Organization",
"name": "Washington Times"
}
}
</script>
But according to this link I've to get review from a trusted review authority. I'm wondering why we need the structured data markup (where we have static 'rating', 'bestRating' etc value definitely these shouldn't be static) or how we can combine this with trusted review authority for getting dynamic ratting that changes over time?
If I'm understanding your question correctly, I think you are confusing two issues. Google requires reviews to be created using Schema markup in order for the review to have a chance to rank directly in the SERPs.
It is the companies that provide reviews: Yelp, Angie's List, Washington Times, etc, that have to format their content management systems to upload user generated review data into the proper markup.
So if you're a web developer working for one of these companies, then it makes sense to code the CMS so that the listings are displayed using schema markup.
If you are the marketer, your job is to get reviews, not format the way they are getting displayed.
There are of course other ways to use Schema markup on your own site to boost organic traffic. Consider for example the first SERP screenshot displayed in this article.
Here the webmaster has used schema markup to list three upcoming events in their result, which gives them four links in a single listing. This causes the listing to stand out and gives increased incentive for users to click, almost guaranteeing a higher click-thru rate than if they'd have not used the markup.

SQL Database for Magic Cardgame

For school I am creating a deckbuilder website based on Magic the gathering. It's the project that decides if I get my degree or not. Trough the website from Deckbrew I have been able to get data like the following:
[
{
"name": "About Face",
"id": "about-face",
"url": "https://api.deckbrew.com/mtg/cards/about-face",
"store_url": "http://store.tcgplayer.com/magic/urzas-legacy/about-face",
"types": [
"instant"
],
"colors": [
"red"
],
"cmc": 1,
"cost": "{R}",
"text": "Switch target creature's power and toughness until end of turn.",
"formats": {
"commander": "legal",
"legacy": "legal",
"vintage": "legal"
},
"editions": [
{
"set": "Urza's Legacy",
"rarity": "common",
"artist": "Melissa A. Benson",
"multiverse_id": 12414,
"flavor": "The overconfident are the most vulnerable.",
"number": "73",
"layout": "normal",
"price": {
"low": 0,
"average": 0,
"high": 0
},
"url": "https://api.deckbrew.com/mtg/cards?multiverseid=12414",
"image_url": "http://mtgimage.com/multiverseid/12414.jpg",
"set_url": "https://api.deckbrew.com/mtg/sets/ULG",
"store_url": "http://store.tcgplayer.com/magic/urzas-legacy/about-face"
}
]
}
]
It's obvious that it's in jSon format. I have found the way to turn this into objects and the structure of the project is 4-layer MVC with entity framework and C#, which is working (kinda)...The problem is the database. I have been working on it for 2 months now and I am not getting any further. The thing I get stuck on is the database. I have not seen much on how to create databases and that's where it goes wrong. I don't get how to build the database. The creation itself would work if I figured out how to include certain things...
1) Formats: if the card is legal in a format, Formats is filled with: "legacy": "legal", "commander":"legal", ... so only the legal formats are included.
2) Types and colors are just plain arrays of words, but since I'm very bad with databases I don't even know how to figure this one out.
3) Editions is something completely different. It's an array of the object Edition which I believe has to have a table of its own. The problem here is that I thought I needed to use a foreign key but since it's an array of Editions I don't really know how to start doing that either.
4) and then there's Price: It always has 3 values: low, average and high which can be 0 if there's no price known.
So here you have it. To me this database is very complex or maybe I am making it too complex. Is there anybody who can help me to get this database organized so I can get on with my project, because I'm so lost at the moment that I feel I am not going to get this ready by the end of next month and that would be awful.
1: No, you should include all.
2: Table with colors, standard m:n binding table in between mapping the card table with the color table. Not knowing how to make a m:n relationship thing makes me thing you skipped all classes... this is fundamental and basic.
3: Seems like "cardedition" is the main table actually, and everything before is a master type table. Not sure- I don't really do magic at all, so I lack what is called domain knowledge. Are cards changed so multiple editions exist? Why is that an array in json?
3: magic values, 0,1,2,3. What is the question?
To me this database is very complex
I suggest you start from scratch (making things easier) and just have maybe 10 or so tables. Go step by step. Follow what you learned, go to 3rd of 4th normal form and go relational.

What simple database can I use to store and query data just for myself?

I have come across various situations, where I want to store some formatted data in a way such that it can be easily queried.
For example
$ cat so.txt
"question_id": 58640,
"tags": ["polls", "fun", "quotes"],
"title": "Great programming quotes"
"question_id": 184618,
"tags": ["polls", "fun", "comment"],
"title": "What is the best comment in source code you have ever encountered?"
"question_id": 3734102,
"tags": ["c++", "linux", "exit-code"],
"title": "Why cant' I return bigger values from main function ?"
"question_id": 2349378,
"tags": ["communication", "terminology", "vocabulary"],
"title": "New programming jargon you coined?"
"question_id": 3723817,
"tags": ["open-source", "project-management", "failure", "fail"],
"title": "How to make an open source project fail"
"question_id": 3699150,
"tags": ["testing", "interview-questions", "job-interview"],
"title": "Interview question please help"
$
A simple query can be displaying the titles of the questions with tags "C++".
These are the requirements
The database has to support just me.
It must be able to support all the general SQL type queries. I am familiar with SQL, so the more it is SQL-like, the better.
It has to be run locally on my Linux machine running Ubuntu 10.04.
Also, since my requirements are minimal, I expect it not to use up too much memory.
What DBMS do you suggest for this purpose?
the code you posted looks like json. if this is the format you primarily keep your data, it's possible that something like couchdb would be ideal for you? I'm a big fan of it, so I'm biased :)
otherwise, the traditional answer to "light database that only supports me" is SQLite.