Problem with classification, POST to classifications results in error - weaviate

If I try to start a classification I receive the error message:
"message": "invalid classification: basedOnProperties: property 'title' must be of type 'text'"
I am running 0.22.0
The property is of the type string, I didn't know of types that are text. Is this right?
The query I have POST to /v1/classifications was:
{
"class": "ClassContainingTitle",
"classifyProperties": ["inOtherclass"],
"basedOnProperties": ["title"],
"type": "contextual"
}

The basedOnProperties should indeed be op dataType text, like the error message mentions. (This is required for the vectorization of the field for the classification).
The best thing to do is this to mention a property that has the correct dataType (text). Is there is none in this class yet, you could change the field of this property from string to text in the schema.
How to start this classification is also reflected in the documentation https://www.semi.technology/documentation/weaviate/current/features/contextual-classification.html#how-to-use.

Related

BizTalk - Catch pipeline Exception. Exception Message gets truncated.

Please have a look at below response in Postman :
“
http://www.xyz.co.uk/ABC/schema/ophthalmicpayments/GOS:Title' element has an invalid value according to its data type.
The 'http://www.xyz.co.uk/ABC/schema/ophthalmicpayments/GOS:DOB' element has an invalid value according to its data type.
The 'http://www.xyz.co.uk/ABC/schema/ophthalmicpayments/GOS:PostCode' element has an invalid value according to its data type.
The 'http://www.xyz.co.uk/ABC/schema/ophthalmicpayments/GOS:NHSNumber' element has an invalid value according to its data type.
The 'http://www.xyz.co.uk/ABC/schema/ophthalmicpayments/GOS:NINumber' element has an invalid value according to its data type.
The 'http://www.xyz.co.uk/ABC/schema/ophthalmicpayments/GOS:Last-Sight-Test' element has an invalid value according to its data type.
The 'http://www.xyz.co.uk/ABC/schema/ophthalmicpayments/GOS:Eligibility-Evidence' element has an invalid value according to its data type.
The 'http://www.xyz.co.uk/ABC/schema/ophthalmicpayments/GOS:Patient' *****element has an inva...".**"*** />
”
Messaga after - element has an inva is truncated.
What you are seeing is the expected behavior. Validation errors can be very long and it's often impractical to return then entire list.
You should resolve the causes of Validation errors in dev (Visual Studio) not testing.

In Google Tag Manager, getting, "Expected a string value for field: "contentGroup1". but found: "object"

I'm trying to set up a content grouping. WordPress is pushing the blog tags into the data layer as pageAttributes. I've got a custom data layer variable in GTM reading this and labeled as blogTagsArray. I used this variable in a tag to set up the content grouping, firing on blog pages. When I debug, everything is firing, but I get an error message:
Expected a string value for field: "contentGroup1". but found: "object".
Is there a second step I need to take to convert the object into a string? Or is there something I can do in this step to correct this?

oozie-error-message: E0803: IO error, E0808: Disallowed user property [user.name]

In the post message, I've a property user.name and oozie responds as follows:
oozie-error-message: E0803: IO error, E0808: Disallowed user property [user.name]
When I remove the property, It gives the following error message:
oozie-error-message: E0401: Missing configuration property [user.name]
It looks crazy and not sure what it wants.
Eventually I need to pass this property in the POST request.
Have you tried renaming the property to be username (no dot)? It could be that it really doesn't like the dot in the name.

return domain objects from grails constraint validation

Is it possible to write your own validator in grails that will return a valid object?
Something like:
static constraints = {
name(validator: {val, obj ->
if (Drink.findByName(val)) return [Drink.findByName(val)]
})
}
In other words - if the Drink already exists in the DB, just return the existing one when someone does a
new Drink("Coke")
and coke is already in the database
You cannot do this with a custom validator. It's not really what it was meant for. From the Grails Reference:
The closure can return:
null or true to indicate that the value is valid
false to indicate an invalid value and use the default message code
a string to indicate the error code to append to the "classname.propertName." string used to resolve the error message. If a field specific message cannot be resolved, the error code itself will be resolved allowing for global error messages.
a list containing a string as above, and then any number of arguments following it, which can be used as formatted message arguments indexed at 3 onwards. See grails-app/i18n/message.properties to see how the default error message codes use the arguments.
An alternative might be to just create a service method that 1) looks for the domain and returns it if it exists, 2) otherwise, saves the domain and returns it.
There's probably a more elegant alternative. Regardless, Grails' constraints mechanism isn't (and shouldn't be) capable of this.
Not sure if you can do this from inside the validator, but:
Drink d = Drink.findOrSaveWhere(name: 'Smooth Drink', alcoholLevel: '4.5')

MVC Localization of Default Model Binder

I am currently trying to figure out how to localize the error messages generated by MVC. Let me use the default model binder as an example, so I can explain the problem.
Assuming I have a form, where a user enters thier age. The user then enters "ten" in to the form, but instead of getting the expected error of
"Age must be beween 18 and 25."
the message
"The value 'ten' is not valid for Age."
is displayed.
The entity's age property is defined below:
[Range(18, 25, ErrorMessageResourceType = typeof (Errors),
ErrorMessageResourceName = "Age", ErrorMessage = "Range_ErrorMessage")]
public int Age { get; set; }
After some digging, I notice that this error text comes from the System.Web.Mvc.Resources.DefaultModelBinder_ValueInvalid in the MvcResources.resx file.
Now, how can create localized versions of this file?
As A solution, for example, should I download MVC source and add MvcResources.en_GB.resx, MvcResources.fr_FR.resx, MvcResources.es_ES.resx and MvcResources.de_DE.resx, and then compile my own version of MVC.dll?
But I don't like this idea. Any one else know a better way?
See http://forums.asp.net/p/1512140/3608427.aspx, scroll down to Brad Wilson's reply near the bottom of that page (Sat, Jan 09 2010, 3:20 PM). There are static properties on the DefaultModelBinder that you can set to localize the generic error messages.
The reason a generic error message is used instead of your [Range] message is that [Range] provides a validation error message, but this particular case is a binding error. There's absolutely no way the framework can ever hope to convert the string "ten" to an Int32, so it can't even fire the [Range] validator. This is what the "PropertyValueInvalid" key as mentioned in that forum controls.
In MVC3 do the following to change default messages:
add the App_GlobalResources folder to your ASP.NET site
add a new resource file, call it f.ex. MyResources.resx
add these keys
PropertyValueRequired: A value is required.
PropertyValueInvalid: The value '{0}' is not valid for {1}.
in Application_Start of global.asax.cs add the line DefaultModelBinder.ResourceClassKey = "MyResources";
Have you tried: IDataErrorInfo property
This article will help
Validating with the IErrorDataInfo
Interface (C#)

Resources