JSON-LD schema won't validate in SDTT - schema

I've spent hours on this without solution. I'm having a terrible time identifying and correcting an error when validating in Google SDTT. After dozens of revisions, I continue to get "Missing ',' or ']' in array declaration" error. I'd appreciate if someone will take a look, make the needed corrections or show me what I'm overlooking. Here's the code snippet >> https://drive.google.com/drive/folders/1HNJgZrGa7_F6-7FuGCbL2Y0vFPGsX7MQ

Your top sameAs is a bit mixed up. I suspect you wanted to quote every URL and drop the last comma. e.g.
"sameAs" : [ "https://plus.google.com/100804793716209856515", "https://plus.google.com/115455274861158767219", "https://www.facebook.com/pg/TallentRoofingInc/about/", "https://www.yelp.com/biz/tallent-roofing-mckinney-2", "https://www.yelp.com/biz/tallent-roofing-melissa", "https://www.yelp.com/biz/tallent-roofing-el-paso-2", "https://www.yelp.com/biz/tallent-roofing-alpine", "https://www.yelp.com/biz/tallent-roofing-artesia" ]
Your graph is an array, but does to some bad closing of }s so it directly includes properties. Remove the } on the line before "aggregateRating" and add one to the line after "reviewCount".
,
"aggregateRating" :
{
"#type": "AggregateRating",
"ratingValue" : "4.9",
"ratingCount": "57",
"reviewCount": "53"
}},

Related

Apply multiple format rules to a single rjsf field

I like the rjsf format api, it works great for me:
"format": "alphanumeric"
But I would like to assign multiple format rules to a single field, and use transformErrors api to display a different message for each, giving user more precise feedback about what's wrong. Something along the lines of:
"format": ["alphanumeric", "mustBeginWithLetter"]
but this array notation doesn't work and breaks the formatting instead :)
Is there a clean way to achieve what I want?
"allOf": [ {"format": "alphanumeric"}, {"format": "mustBeginWithLetter"} ]

[odoo10]How to save the record while odoo warning is happend?

In my custom module I added the
application_no = fields.Char(string="Application Number")
_sql_constraints = [
('application_no_unique',
'UNIQUE(application_no)',
"Application Number already exist.Please specify another number or make sure the application number is correct"),
]
and I use sql constraint to shows warning.
It works correctly, When we entered duplicate application number it shows the warning and access to saving the record is prevented
Question
How to save the record while warning happens??
note
I think SQL constraint is not suited for this.
is any other method for this functionality?
I think it might help you to use an onchange method :
#api.onchange('your_field')
def your_onchange(self):
count=self.search_count([('your_field','=',self.your_field)])
return {
'warning': {'title': _('Warning'), 'message': _('Warning message'),},
}
This will show you the message and you can save without problems. I hope this help you.

PostgreSQL: Create Index in JSON Array

I am pretty new to postregSQL and not too familiar with SQL yet. But im trying to learn.
In my database i want to store huge JSON files (~2mio lines, 40mb) and later query them as fast as possible. Right now it is to slow, so i figured indexing should do the trick.
The Problem is i do not know how to index the file since it is a bit tricky. I am woking on it the whole day now and starting to get desperate..
My DB is calles "replays" the json column "replay_files"
So my files look like this:
"replay": [
{
"data": {
"posX": 182,
"posY": 176,
"hero_name": "CDOTA_Unit_Hero_EarthSpirit"
},
"tick": 2252,
"type": "entity"
},
{
"data": {
"posX": 123,
"posY": 186,
"hero_name": "CDOTA_Unit_Hero_Puck"
},
"tick": 2252,
"type": "entity"
}, ...alot more lines... ]}
I tried to get all the entries with say heron_name: Puck
So i tried this:
SELECT * FROM replays r, json_array_elements(r.replay_file#>'{replay}') obj WHERE obj->'data'->>'hero_name' = 'CDOTA_Unit_Hero_Puck';
Which is working but for smaller files.
So i want to index like that:
CREATE INDEX hero_name_index ON
replays ((json_array_elements(r.replay_file#>'{replay}')->'data'->'hero_name);
BUt it doesn work. I have no idea how to reach that deep into the file and get to index this stuff.
I hope you understand my problem since my english isnt the best and can help me out here. I just dont know what else to try out.
Kind regards and thanks alot in advance
Peter

simplecart js setting column widths

I've used this site for assistance many times but never had to ask a question so finally joined...anyway, trying to set up simplecart checkout and having some trouble formatting cart output. I have my cart set to table and by default the simpleCart_items class displays the table and it's cells only as wide as they need be to fit the data. I can change this by specifying all cells(columns) as a percentage of the whole table. Unfortunately with 7 columns each only gets about 14% and this is way to much for a 1 or 2 digit quantity and not near big enough for all the characters in the item name without wrapping. What I want is a way to define a different width for each column. I have not found a way to do this even with colgroup but maybe just not doing it right. Any and all help would be appreciated!
Okay, so this may or may not help. This line is located in the simpleCart.js file. I changed it to something simple.
cartColumns : [
{ view: function(item, column){
return"<img src='"+item.get('image')+"' width='250px' height='250px'><br /><center><h3 ><span>"+item.get('name')+"</span></h3><p><a href='javascript:;' class='simpleCart_decrement'><button>-</button></a> "+item.get('quantity')+" <a href='javascript:;' class='simpleCart_increment'><button>+</button></a></p><p>$"+item.get('price')+"</p><p><a href='javascript:;' class='simpleCart_remove remove_icon'><img src='images/icon_x.png' /></a></p></center>";
},
}
],
You can change it to your own html
cartColumns : [
{ view: function(item, column){
return" YOUR HTML HERE ";
},
}
],
It MUST all be in ONE (1) LINE or else it may not work.
here are some values that are used
image = item.get('image')
name = item.get('name')
quantity = item.get('quantity')
price = item.get('price')
you can look at all the values here
http://simplecartjs.org/documentation/displaying_cart_data
but the point is that you can make a cart and display it how you want; with you own html and css. I hope this helped.

Azure HBASE REST - simple get failing for colfam:col

This should be a very simple one (been searching for a solution all day - read a thousand and a half posts).
I put a test row in my HBASE table in hbase shell:
put 'iEngine','testrow','SVA:SourceName','Journal of Fun'
I can get the value for a column family using the REST API in DHC Chrome:
https://ienginemaster.azurehdinsight.net/hbaserest/iEngine/testrow/SVA
I can't seem to get it for the specific cell: https://ienginemaster.azurehdinsight.net/hbaserest/iEngine/testrow/SVA:SourceName
{
"Row": [{
"key": "dGVzdHJvdw==",
"Cell": [{
"column": "U1ZBOlNvdXJjZU5hbWU=",
"timestamp": 1440602453975,
"$": "Sm91cm5hbCBvZiBGdW4="
}]
}]
}
I get back a 400 error.
When successfully asking for just the family, I get back:
I tried replacing the encoded value for SVA:SourceName, and a thousand other things. I'm assuming I'm missing something simple.
Also, the following works:
hbase(main):012:0> get 'iEngine', 'testrow', 'SVA:SourceName'
COLUMN CELL
SVA:SourceName timestamp=1440602453975, value=Journal of Fun
1 row(s) in 0.0120 seconds
hbase(main):013:0>
I opened a case with Microsoft support. I received confirmation that it is a bug (IIS and the colon separator not working). They are working on a fix - they are slightly delayed as the decide on the "best" way to fix it.