Regular Expression "not matching" and SPARQL Filter function usage

Source: Internet
Author: User

OK, I had a problem here when converting bio2rdf.org irefindex data to nanopublication using SPARQL here:

In a database, if the item is looking for have multiple types, but you have only need one of those types in your converted Data, what are can do-is-use-a SPARQL filter function with regex

1. The proper SPARQL filter syntax is as follows:

Selectwhere{  ? s? P O.    for filter) #it ' s brackets () not curly parenthesis {}}

2. The proper regex to match those items if you don ' t want

^. *? (? < ! Resource) $ # The Regex filter regex (? Interaction_type, "^. *? (? <  Use  in the filter
^.*? (?<
2. For example, find a string that does not end in COM.
www.sina.com.cn
www.educ.org
www.hao.cc
Www.baidu.com

^.*? (? <!com) $ matches the first 3 rows of results. If you look for a string that ends in COM, use regular ^.*? (? <=com) $ or ^.*?com$


Online regex tester is also very helpful when debugging your regex:https://regex101.com/

Regular Expression "not matching" and SPARQL Filter function usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.