why an URL appears in my query results using the SPARQL? - sparql

The query that is in the picture is done using the SPARQL and Protege, it is used to retrieve the phases names but an URL appear beside the name how can I remove this URL? Or is there any mistake found in the query that makes this happen?
query and result's picture

The literal values you are retrieving are typed literals.
As #AKSW commented, use the STR() function to get the untyped lexical form.

Related

Difference between Placeholder and parameter

I was watching a course about JDBC and when the Instructor was speaking about ? (Question Mark) in Prepared Statement, he said:
Before I execute the Query, I have to fill in the placeholders or parameters.
he was talking about a query like this:
SELECT * FROM Employee where salary > ?
Now, my main question is:
what is difference between placeholder and parameter?
and isn't he wrong? can ? be either placeholder or parameter?
Edit:
I consider these two definition also:
argument is the value/variable/reference being passed in, parameter is the receiving variable
There is no difference, these are just two terms used for the same things. Which is probably why that phrase was used: to introduce both terms and indicate they can be used interchangeably. There is even a third variant where both are combined in a single term: parameter placeholder.
As I see it, the ? is a placeholder for a value, but at the same time a parameter for the query.

How to pass arguments from an Access form to SQL Query with "IN" clause?

I'm having trouble getting this query to display any results.
SELECT Evaluation_Table.*
FROM Evaluation_Table
WHERE (Evaluation_Table.Test_ID
In ([Forms]![Test Data]![Group_Test_IDs]));
The control, [Group_Test_IDs] is a textbox that contains a string of IDs. For example it just contains numbers separated by commas: 1,2,3,4,5.
While debugging, If I changed the query to look like this, it properly returns records:
SELECT Evaluation_Table.*
FROM Evaluation_Table
WHERE (Evaluation_Table.Test_ID
In (1,2,3,4,5));
I can't seem to find the proper syntax. SQL in Access can sometimes be weird.
I can't seem to find the proper syntax.
That's because there is none.
The IN selection cannot be dynamic; your only option is to rewrite the SQL via VBA.

SELECT query using LIKE property in Microsoft Access returns no results when it should

I'm sure I'm making some kind of rookie error here, but I have no idea what the problem is. I am trying to run a simple query on one table in a microsoft access database using the LIKE property to find records that have a certain text string in a particular field. More specifically, the table, called Catreqs, has a few fields, bib_num, MARC_336, MARC_337, and MARC_338. The MARC_336 field has a text string in it and I want a query that selects all the records for which that text string includes the characters "txt".
Here's my query:
SELECT [Catreqs].record_num, [Catreqs].MARC_336
FROM [Catreqs]
WHERE [Catreqs].MARC_336 Like '%txt%';
I should note that I created this query in MS Access design view and this is the query that was generated when I switched to SQL view. I am a little familiar with SQL and even less familiar with Access so this is actually my preferred way of dealing with it.
I've also tried using Like '*txt*' but that didn't return any results either. For reference, here is the entire text string these characters are in:
text txt rdacontent
Any suggestions thoughts on why this fails and how I can fix it?
Thanks!
In Access, for a string you must use the * character.
Check if [Catreqs] has rows where MARC_336 contains "txt".
This is the official documentation of Access:
https://support.office.com/en-us/article/Like-Operator-b2f7ef03-9085-4ffb-9829-eef18358e931?ui=it-IT&rs=en-001&ad=IT&omkt=en-001

Sparql Query Results without Namespace

I want to get results from sparql query and the results contain no namespace.
ex: there is result in triple format like:
"http://www.xyz.com#Raxit" "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" "http://www.xyz.com#Name"
So i want to get only following:
Raxit type Name
I want to get this results directly from sparql query. I am using virtuoso.
Is it possible to get this from sparql?
Please share your thoughts regarding this.
Thanks in Advance.
If your data is regular, and you know that the sub-string you want always occurs after a # character, then you can use the strafter function from SPARQL 1.1. I do not know whether this is available in Virtuoso's implementation or not.
However this is, in general, a very risky strategy. Not all URI's are formatted with a local name part after a # character. In fact, in general, a URI may not have a legal or useful localname at all. So you should ask yourself: why do you think you need this? Generally speaking, a semantic web application uses the whole URI as an indivisible identifier. If your need is actually for something human-friendly to display in a UI, have your query also look for rdfs:label or skos:label properties. Worst case, try to abbreviate the URI to q-name form (i.e. prefix:name), using the prefixes from the model or a service like prefix.cc
The simplest way to achieve this is to not bother with adapting your query, but to just post-process the result yourself. Depending on which client library you use to communicate with Virtuoso, you will typically find it has API support to parse the result, get back values, and for each value then get only local name (I suggest you look for a URI.getLocalName() method or something similar).

How do I use native Lucene Query Syntax?

I read that Lucene has an internal query language where one specifies : and you make combinations of these using boolean operators.
I read all about it on their website and it works just fine in LUKE, I can do things like
field1:value1 AND field2:value2
and it will return seemingly correct results.
My problem is how do I pass this who Lucene query into the API? I've seen QueryParser, but I have to specifiy a field. Does this mean I still have to manually parse my input string, fields, values, parenthesis, etc or is there a way to feed the whole thing in and let lucene do it's thing?
I'm using Lucene.NET but since it's a method by method port of the orignal java, any advice is appreciated.
Are you asking whether you need to force your user to enter the field? If so, the query parser has a default field. Here's a little more info. As long as you have a default field that will do the job, they don't need to specify fields.
If you're asking how to get a Query object from the String, you need the parse method. It understands about fields, and the default field, etc. mentioned earlier. You just need to make sure that the query parser and the index builder are both using the same analysis.