Makes using a URI as predicate them to a property? - properties

I have only the following Turtle statement:
x isAuthorOf y
If I have only this statement where isAuthorOf is used as a predicate, means this that I can conclude that isAuthorOf is also a Property without instanciation (isAuthorOf rdf:type rdfs:Property)?
Thanks in advance.

Yes, an IRI used ad a property implies it is a property. However, without declaration you won't know if it's a datatype or an object property.

Related

SPARQL - Returning label when object is URI or string when object is Literal

I would like to get the labels (rdfs:label) of objects when the object is a URI. But I would also like to get the string values when the object is a literal string. The issue is, I do not know beforehand if the object is storing a literal or a URI, and in some cases I see a mix of both literals and URIs, like in the image attached.
Any suggestions on how I can return the strings, and if there's an object, return the rdfs:label?
Thanks for your help!
First, this problem shouldn't occur in an ideal world because a property is supposed to be either an object property or a datatype property.
However, when dealing with low quality data where this does occur, I suggest the following workaround:
SELECT ?x ?desc
{
?x dbp:keyPeople ?y.
{?y rdfs:label ?desc. FILTER(isIRI(?y))} UNION
{BIND(STR(?y) AS ?desc). FILTER(!isIRI(?y))}
}
Warning
This is not thoroughly tested. I could only verify that it works correctly on DBpedia Live, which uses Virtuoso 08.03.3319. On the default DBpedia endpoint https://dbpedia.org/sparql on Virtuoso version 07.20.3235 it seems to not work correctly. Also, you need to uncheck both "Strict checking of void variables" and
"Strict checking of variable names used in multiple clauses but not logically connected to each other".

What does the syntax ->* mean?

I have read some documents about the syntax ->*, but i still don't get it. Can anyone explain what it means and in what scenarios I can use it?
I have that syntax in this example:
assign ovs_callback_object->query_parameters->* to <ls_query_params> CASTING.
refvar->* is used to de-reference an unstructured reference variable. For a structured reference, you would use structref->component to access a component of the referenced object (an attribute of an object or a component of a structure). If you have something like TYPE REF TO i, there's no inner structure, so you have to use the special syntax ->*. It's all in the documentation...
The ->* operator is the "Dereference" operator. It turns a TYPE REF TO something into a TYPE something.
In your example, ovs_callback_object->query_parameters is likely a reference, but you don't want to assign the reference to the field-symbol, you want to assign the actual field the reference points to.

Core Data - Fetch object with optional attribute

I have an EntityA which has an optional attribute int32 result. When I create EntityA I do not set the result attribute. Then later on when I fetch it I expect it to have nil value but for some reason it's set to 3 even though I have not set this attribute.
What's going on here?
1st possible issue:
You have set a default value in the model editor. Select the attribute and check the inspector.
2nd possible issue:
You are retrieving or showing the wrong value. Show the code you are using to find out that result is '3'.
3rd possible issue:
You are setting the value later inadvertently, perhaps in a loop or something similar. Do a text search for the attribute to find a possible occurrence in your code.
Your int32 will be stored wrapped into a NSNumber object. If you don't provide a value, no NSNumber object will be created - sql will treat it as NULL.
The iOS Core Data Programming Guide says:
You can specify that an attribute is optional—that is, it is not
required to have a value. In general, however, you are discouraged
from doing so—especially for numeric values (typically you can get
better results using a mandatory attribute with a default value—in the
model—of 0). The reason for this is that SQL has special comparison
behavior for NULL that is unlike Objective-C's nil. NULL in a database
is not the same as 0, and searches for 0 will not match columns with
NULL.
So, it may be better to either make the attribute mandatory and set it to a distinct value, or to pass in NSNumber from the start.

How can I print a servlet context attribute in EL?

Is there a way I can get a attribute set in ServletContext in EL so that it ends up as a JavaScript variable?
I am setting it as
context.setAttribute("testing.port", "9000");
I tried retrieving it like
alert("port" +'${testing.port}');
I am just getting a blank.
The problem is the period (.) in the key name. EL interprets the period as a call to an accessor method named getPort1 on whatever object testing references. Fetch the value from the appropriate implicit object:
${applicationScope['testing.port']}
or just use a different key:
${testingPort}
1Yes, this is a simplification of what really happens. It may also look for a predicate getter named isPort, or try Map#get("port").

MSAccess use of special character

I have got a very strange problem.
In the earlier version of programm i have found the following statement inside a query.
table1!field1 > table2!Field2
I ma not able to understand the meaning of the ! sign here.
Can any one able to help me in this regard
thank you in advance
! means default property with String parameter type in VB/VBA. Apparently Table object has default property Field("fieldname") and Field object has default property Value, thereby instead of table1.Field("field1").Value you can use shortcut notation table1!field1.